Browse Source

added DOS_1571_03

master
Michael Steil 2 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 @@
1
+        .page
2
+	.subttl 'burst'
3
+	*=$8000
4
+
5
+signature_lo .byte $FF	; <<<< TO BE DETERMINED
6
+signature_hi .byte $FF  ; <<<< TO BE DETERMINED
7
+
8
+
9
+	.byte  'S/W - DAVID G SIRACUSA',$0D,"H/W - GREG BERLIN",$0D,'1985',$0D
10
+
11
+burst_routines
12
+
13
+	lda  cmdsiz     ; check command size
14
+	cmp  #3
15
+	bcc  realus
16
+
17
+	lda  cmdbuf+2	; get command
18
+	sta  switch	; save info
19
+	and  #$1f
20
+	tax		; command info
21
+	asl  a
22
+	tay
23
+	lda  cmdtbb,y
24
+	sta  ip
25
+	lda  cmdtbb+1,y
26
+	sta  ip+1
27
+	cpx  #30	; utload ok for 1541 mode
28
+	beq  1$
29
+
30
+	lda  pota1
31
+	and  #$20	; 1/2 Mhz ?
32
+	beq  realus	; 1541 mode...ignore
33
+
34
+1$	lda  fastsr	; clear clock & error return
35
+	and  #$eb
36
+	sta  fastsr
37
+
38
+	lda  cmdctl,x   ; most sig bit set set error recover
39
+	sta  cmdbuf+2	; save info here
40
+
41
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
42
+
43
+	jmp  ptch65	
44
+;	jmp  (ip)	; *** rom ds 04/25/86 ***
45
+
46
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
47
+
48
+realus  lda  #<ublock   ; set default block add
49
+        sta  usrjmp      
50
+        lda  #>ublock    
51
+        sta  usrjmp+1    
52
+unused  rts      
53
+
54
+	.page
55
+
56
+; command tables and information
57
+
58
+cmdctl   .byte  $80,$81,$90,$91,$b0,$b1,$f0,$f1,$00,$01,$B0,$01,$00,$01,$00,$01
59
+         .byte  $80,$81,$90,$91,$b0,$b1,$f0,$f1,$00,$01,$B0,$01,$00,$01,$00,$80
60
+
61
+cmdtbb   .word    fstrd  	 ; fast read drv #0 - 0000
62
+	 .word    ndkrd 	 ; fast read drv #1 - 0001
63
+
64
+	 .word    fstwrt         ; fast write drv #0 - 0010
65
+	 .word    ndkwrt	 ; fast write drv #1 - 0011
66
+
67
+         .word    fstsek         ; seek disk drv #0 - 0100
68
+         .word    ndkrd          ; seek disk drv #1 - 0101
69
+
70
+         .word    fstfmt         ; format disk drv #0 - 0110
71
+         .word    fstfmt         ; format disk drv #1 - 0111
72
+
73
+         .word    cpmint	 ; interleave disk drv #0 - 1000
74
+         .word    cpmint	 ; interleave disk drv #1 - 1001
75
+
76
+	 .word    querdk	 ; query disk format - 1010
77
+         .word    ndkrd          ; seek disk drv #1 - 1011
78
+
79
+	 .word    inqst		 ; return disk status - 1100
80
+	 .word    ndkrd		 ; return disk status - 1101
81
+
82
+	 .word    duplc1	 ; backup drv0 to drv1 - 1110
83
+	 .word    duplc1	 ; backup drv1 to drv0 - 1111
84
+
85
+; *****************************************************************
86
+	
87
+	 .word    fstrd  	 ; fast read drv #0 - 0000
88
+	 .word    ndkrd 	 ; fast read drv #1 - 0001
89
+
90
+	 .word    fstwrt         ; fast write drv #0 - 0010
91
+	 .word    ndkwrt	 ; fast write drv #1 - 0011
92
+
93
+         .word    fstsek         ; seek disk drv #0 - 0100
94
+         .word    ndkrd          ; seek disk drv #1 - 0101
95
+
96
+         .word    fstfmt
97
+         .word    fstfmt
98
+
99
+         .word    unused
100
+         .word    unused
101
+
102
+	 .word    querdk	 ; query disk format - 1010
103
+         .word    ndkrd          ; seek disk drv #1 - 1011
104
+
105
+         .word    unused
106
+         .word    unused
107
+
108
+         .word    chgutl
109
+         .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 @@
1
+	.page 
2
+	.subttl 'gcrcntrl.src'
3
+
4
+;    *contrl
5
+;    main controller loop
6
+;    scans job que for jobs
7
+;    finds job on current track
8
+;    if it exists
9
+
10
+jlcc    tsx             ; save current stack pointer
11
+        stx  savsp      ; *
12
+	
13
+	bit  t1lc2	; reset irq flag
14
+	lda  pcr2	; enable SO
15
+	ora  #$0e
16
+	sta  pcr2
17
+
18
+jtop    ldy  #numjob-1  ; pointer into job que
19
+2$	lda  jobs,y     ; find a job (msb set)
20
+        bmi  3$		; branch if there is a job
21
+        dey      
22
+        bpl  2$
23
+
24
+	jmp  jend         
25
+
26
+3$      cmp  #fread	; fast read cmd
27
+	bne  1$
28
+
29
+        jmp  jread01    ; fill, same track read job
30
+
31
+1$      cmp  #jumpc	; jump cmd ?
32
+	bne  15$
33
+
34
+	jmp  exdo
35
+
36
+15$	and  #drvmsk    ; get drive #
37
+	beq  5$	
38
+	
39
+	sty  jobn
40
+	lda  #15
41
+	jmp  jerrr	; bad drv
42
+
43
+5$      tax      
44
+        cmp  cdrive     ; test if current drive
45
+        beq  7$	
46
+
47
+        sta  cdrive      
48
+        jsr  turnon     ; turn drive on
49
+        jmp  jend       ; go clean up
50
+
51
+7$	lda  drvst      ; test if motor up to speed
52
+        bmi  8$
53
+
54
+        asl  a          ; test if stepping
55
+        bpl  9$		; not stepping
56
+
57
+8$	jmp  jend         
58
+
59
+9$	lda  #$20       ; status=running
60
+        sta  drvst       
61
+
62
+	ldy  #numjob-1   
63
+        sty  jobn        
64
+
65
+10$	jsr  jsetjb       
66
+        bmi  11$
67
+
68
+12$	dec  jobn        
69
+        bpl  10$
70
+
71
+        ldy  nxtjob      
72
+        jsr  jsetjb1      
73
+
74
+        lda  nxtrk       
75
+        sta  steps       
76
+        asl  steps      ; steps*2
77
+
78
+        lda  #$60       ; set status=stepping
79
+        sta  drvst       
80
+
81
+        lda  (hdrpnt),y ; get dest track #
82
+        sta  drvtrk      
83
+	jmp  jend         
84
+
85
+11$	and  #drvmsk    ; test if same drive
86
+        cmp  cdrive      
87
+        bne  12$	; test if current drive
88
+
89
+        lda  drvtrk      
90
+        beq  13$	; uninit. track #
91
+
92
+	lda  drvtrk	; we are here
93
+	cmp  #36	; destination
94
+	php		; save status
95
+        lda  (hdrpnt),y ; destination
96
+	cmp  #36
97
+	ror  a		; rotate to sign bit
98
+	plp		; retrieve carry
99
+	and  #$80	; retrieve sign
100
+	bcc  16$	; br, we are on side 0
101
+
102
+	bmi  17$	; br, we are on side 1 & our dest is side 1
103
+
104
+; a change ...
105
+
106
+        lda  drvtrk	; we are on side 1 & and our dest is side 0
107
+	sbc  #35	; so decrement where we are
108
+        sta  drvtrk
109
+	jmp  17$
110
+
111
+16$	bpl  17$	; br, we are on side 0 & our dest is side 0
112
+
113
+; a change ...
114
+
115
+	lda  drvtrk	; we are on side 0 & our dest is side 1
116
+	adc  #35
117
+ 	sta  drvtrk
118
+17$	sec
119
+        lda  (hdrpnt),y          
120
+        sbc  drvtrk      
121
+        beq  13$	; on track
122
+
123
+        sta  nxtrk       
124
+        lda  jobn       ; save job# and dist to track
125
+        sta  nxtjob      
126
+
127
+        jmp  12$
128
+
129
+
130
+13$	ldx  #4         ; set track and sector
131
+	lda  (hdrpnt),y          
132
+        sta  tracc       
133
+	cmp  #36	; second side ?
134
+	tay		; save track
135
+	jsr  set_side	; adjust h/w and set appropiate flag
136
+	tya		; restore track
137
+	bcc  14$
138
+
139
+	sbc  #35	; track 36 is track 1 physically
140
+			
141
+14$	tax
142
+	lda  worktbl-1,x
143
+        sta  sectr	; select density
144
+
145
+        lda  dskcnt
146
+        and  #$9f       ; clear density bits
147
+        ora  sectr
148
+        sta  dskcnt	; set density bits
149
+
150
+        lda  num_sec-1,x    
151
+        sta  sectr      ; get # of sector
152
+
153
+        lda  job        ; yes, go do the job
154
+        cmp  #bump-$80  ; test for bump
155
+        beq  jbmp         
156
+
157
+	cmp  #execd
158
+	beq  exdo
159
+
160
+        cmp  #frmt-$80  ; is it a format code
161
+        beq  jfmt         
162
+
163
+        jmp  jseak      ; do a sector seek
164
+
165
+jfmt    jmp  jformt     ; do the format
166
+
167
+exdo    lda  jobn
168
+	clc
169
+	adc  #>bufs
170
+	sta  bufpnt+1
171
+	lda  #0
172
+	sta  bufpnt
173
+	jmp  (bufpnt)
174
+
175
+jbmp              
176
+        lda  #$60       ; set status=stepping
177
+        sta  drvst       
178
+        lda  dskcnt
179
+        and  #$ff-$03   ; set phase a
180
+        sta  dskcnt
181
+
182
+        lda  #256-92    ; step back 45 traks
183
+        sta  steps       
184
+	lda  side 	; what side are we on ?
185
+	bmi  1$
186
+
187
+	lda  #$01	; drvtrk now 1
188
+	.byte skip2
189
+1$	lda  #36	; drvtrk now 36
190
+        sta  drvtrk      
191
+	lda  #1
192
+        jmp  jerrr        
193
+
194
+jsetjb  ldy  jobn        
195
+jsetjb1 lda  jobs,y      
196
+        pha      
197
+        bpl  1$		; no job here
198
+
199
+        and  #$78        
200
+        sta  job         
201
+        tya      
202
+        asl  a   
203
+        adc  #<hdrs     ; hdrpnt,trk,sec for job
204
+        sta  hdrpnt      
205
+        lda  #>hdrs      
206
+        sta  hdrpnt+1    
207
+        tya             ; point at buffer
208
+        clc      
209
+        adc  #>bufs      
210
+        sta  bufpnt+1    
211
+
212
+1$	ldy  #0          
213
+        sty  bufpnt      
214
+        pla      
215
+        rts      
216
+
217
+
218
+set_side 
219
+	bcs  1$
220
+	lda  #0	
221
+	.byte  skip2
222
+1$	lda  #$84
223
+	sta  side
224
+	lda  pota1
225
+	and  #$ff-4
226
+	ora  side
227
+	sta  pota1
228
+	rts
229
+
230
+	
231
+worktbl ; table of track densities
232
+	.byte $60,$60,$60,$60,$60,$60,$60,$60,$60,$60
233
+	.byte $60,$60,$60,$60,$60,$60,$60
234
+	.byte $40,$40,$40,$40,$40,$40,$40
235
+	.byte $20,$20,$20,$20,$20,$20
236
+	.byte $00,$00,$00,$00,$00
237
+
238
+num_sec ; number of sectors per track
239
+	.byte 21,21,21,21,21,21,21,21,21,21
240
+	.byte 21,21,21,21,21,21,21
241
+	.byte 19,19,19,19,19,19,19
242
+	.byte 18,18,18,18,18,18
243
+	.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 @@
1
+	.page   
2
+	.subttl  'lcccntrl.src'     
3
+;
4
+;
5
+;
6
+;    *contrl
7
+;
8
+;    main controller loop
9
+;
10
+;    scans job que for jobs
11
+;
12
+;   finds job on current track
13
+;   if it exists
14
+;
15
+lcc              
16
+;
17
+        tsx     	;  save current stack pointer
18
+        stx  savsp       
19
+;
20
+        lda  t1lc2      ; reset irq flag
21
+;
22
+        lda  pcr2       ;  enable s.o. to 6502
23
+        ora  #$0e       ;  hi output
24
+        sta  pcr2        
25
+;
26
+;
27
+;
28
+top     ldy  #numjob-1  ;  pointer into job que
29
+;
30
+cont10           
31
+        lda  jobs,y     ;  find a job (msb set)
32
+        bpl  cont20     ;  not one here
33
+;
34
+        cmp  #jumpc     ;  test if its a jump command
35
+        bne  cont30      
36
+;
37
+        tya     	;  put job num in .a
38
+        jmp  ex2         
39
+;
40
+;
41
+cont30           
42
+        and  #1         ;  get drive #
43
+        beq  cont35      
44
+;
45
+        sty  jobn        
46
+        lda  #$0f       ; bad drive # error
47
+        jmp  errr        
48
+;
49
+cont35  tax      
50
+        sta  drive       
51
+;
52
+        cmp  cdrive     ;  test if current drive
53
+        beq  cont40      
54
+;
55
+        jsr  turnon     ;  turn on drive
56
+        lda  drive       
57
+        sta  cdrive      
58
+        jmp  end        ;  go clean up
59
+;
60
+;
61
+cont40  lda  drvst      ;  test if motor up to speed
62
+        bmi  cont50      
63
+;
64
+        asl  a          ;  test if stepping
65
+        bpl  que        ;  not stepping
66
+;
67
+cont50  jmp  end         
68
+;
69
+cont20  dey      
70
+        bpl  cont10      
71
+;
72
+        jmp  end         
73
+;
74
+;
75
+que     lda  #$20       ;  status=running
76
+        sta  drvst       
77
+;
78
+        ldy  #numjob-1   
79
+        sty  jobn        
80
+;
81
+que10   jsr  setjb       
82
+        bmi  que20       
83
+;
84
+que05   dec  jobn        
85
+        bpl  que10       
86
+;
87
+;
88
+        ldy  nxtjob      
89
+        jsr  setjb1      
90
+;
91
+        lda  nxtrk       
92
+        sta  steps       
93
+        asl  steps      ;  steps*2
94
+;
95
+        lda  #$60       ;  set status=stepping
96
+        sta  drvst       
97
+;
98
+;
99
+        lda  (hdrpnt),y         ;  get dest track #
100
+        sta  drvtrk      
101
+fin     jmp  end         
102
+;
103
+;
104
+que20   and  #1         ;  test if same drive
105
+        cmp  drive       
106
+        bne  que05       
107
+;
108
+        lda  drvtrk      
109
+        beq  gotu       ;  uninit. track #
110
+;
111
+        sec     	;  calc distance to track
112
+        sbc  (hdrpnt),y          
113
+        beq  gotu       ;  on track
114
+;
115
+        eor  #$ff       ;  2's comp
116
+        sta  nxtrk       
117
+        inc  nxtrk       
118
+;
119
+        lda  jobn       ;  save job# and dist to track
120
+        sta  nxtjob      
121
+;
122
+        jmp  que05       
123
+;
124
+;
125
+;
126
+;
127
+gotu    ldx  #4         ;  set track and sectr
128
+        lda  (hdrpnt),y          
129
+        sta  tracc       
130
+;
131
+gotu10  cmp  trknum-1,x
132
+;
133
+        dex      
134
+        bcs  gotu10      
135
+;
136
+        lda  numsec,x    
137
+        sta  sectr       
138
+;
139
+        txa     	;  set density
140
+        asl  a   
141
+        asl  a   
142
+        asl  a   
143
+        asl  a   
144
+        asl  a   
145
+        sta  work        
146
+;
147
+        lda  dskcnt      
148
+        and  #$9f       ;  clear density bits
149
+        ora  work        
150
+        sta  dskcnt      
151
+;
152
+        ldx  drive      ;  drive num in .x
153
+;
154
+        lda  job        ;  yes, go do the job
155
+        cmp  #bumpc     ;  test for bump
156
+        beq  bmp         
157
+;
158
+;
159
+exe     cmp  #execd     ;  test if execute
160
+        beq  ex          
161
+;
162
+        jmp  seak       ;  do a sector seek
163
+;
164
+ex      lda  jobn       ;  jump to buffer
165
+ex2     clc      
166
+        adc  #>bufs      
167
+        sta  bufpnt+1    
168
+        lda  #0          
169
+        sta  bufpnt      
170
+ex3     jmp  (bufpnt)    
171
+;
172
+;
173
+bmp              
174
+        lda  #$60       ;  set status=stepping
175
+        sta  drvst       
176
+;
177
+        lda  dskcnt      
178
+        and  #$ff-$03   ;  set phase a
179
+        sta  dskcnt      
180
+;
181
+;
182
+        lda  #256-92    ;  step back 45 traks
183
+        sta  steps       
184
+;
185
+        lda  #1         ;  drvtrk now 1
186
+        sta  drvtrk      
187
+;
188
+        jmp  errr       ;  job done return 1
189
+;
190
+;
191
+setjb   ldy  jobn        
192
+setjb1  lda  jobs,y      
193
+        pha      
194
+        bpl  setj10     ;  no job here
195
+;
196
+        and  #$78        
197
+        sta  job         
198
+        tya      
199
+        asl  a   
200
+        adc  #<hdrs      
201
+        sta  hdrpnt      
202
+        tya     	;  point at buffer
203
+        clc      
204
+        adc  #>bufs      
205
+        sta  bufpnt+1    
206
+;
207
+;
208
+setj10  ldy  #0          
209
+        sty  bufpnt      
210
+;
211
+        pla      
212
+        rts      
213
+;
214
+;
215
+;
216
+;.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 @@
1
+        .page  
2
+        .subttl 'lccutil1.src'
3
+
4
+;  * utility routines
5
+
6
+jerrr   ldy  jobn       ; return  job code
7
+        sta  jobs,y      
8
+
9
+        lda  gcrflg     ; test if buffer left gcr
10
+        beq  1$		; no
11
+
12
+        jsr  jwtobin    ; convert back to binary
13
+
14
+1$      jsr  trnoff     ; start timeout on drive
15
+
16
+        ldx  savsp       
17
+        txs     	; reset stack pointer
18
+
19
+        jmp  jtop       ; back to the top
20
+
21
+;   motor and stepper control
22
+;   irq into controller every 8ms
23
+
24
+jend              
25
+        lda  t1hl2	; set irq timer
26
+	sta  t1hc2
27
+
28
+	lda  dskcnt
29
+        and  #$10	; wpsw 
30
+        cmp  lwpt       ; same as last
31
+        sta  lwpt       ; update 
32
+        bne  1$
33
+
34
+        lda  mtrcnt     ; anything to do?
35
+        bne  7$		; dec & finish up
36
+
37
+        beq  2$		; nothing to do
38
+
39
+1$	lda  #$ff        
40
+        sta  mtrcnt     ; 255*8ms motor on time
41
+        jsr  moton       
42
+
43
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
44
+
45
+	jsr  ptch72	; *** rom ds 05/20/86 ***
46
+	nop
47
+;       lda  #1          
48
+;       sta  wpsw        
49
+
50
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
51
+
52
+        bne  2$		; bra
53
+
54
+7$      dec  mtrcnt     ; dec & return
55
+        bne  2$
56
+        lda  drvst       
57
+        cmp  #$00       ; motor off & no active drive ?
58
+        bne  2$		; br, do not turn it off something is going on
59
+
60
+        jsr  motoff      
61
+
62
+2$      lda  phase	; test for phase offset
63
+        beq  5$
64
+
65
+        cmp  #2          
66
+        bne  3$
67
+
68
+        lda  #0          
69
+        sta  phase
70
+        beq  5$		; bra
71
+
72
+3$	sta  steps       
73
+        lda  #2          
74
+        sta  phase
75
+        jmp  6$
76
+
77
+5$	ldx  cdrive     ;  work on active drive only
78
+        bmi  8$		;  no active drive
79
+
80
+        lda  drvst      ;  test if motor on
81
+        tay      
82
+        cmp  #$20       ;  test if anything to do
83
+        bne  9$		;  something here
84
+
85
+8$	jmp  10$	;  motor just running
86
+
87
+9$	dec  acltim     ;  dec timer
88
+        bne  11$
89
+	
90
+        tya     	;  test if acel
91
+        bpl  12$
92
+
93
+
94
+        and  #$7f       ;  over, clear acel bit
95
+        sta  drvst       
96
+
97
+12$	and  #$10       ;  test if time out state
98
+        beq  11$
99
+
100
+	dec  acltim2	;  decrement second timer
101
+	bne  11$	
102
+
103
+	jsr  motoff      
104
+
105
+        lda  #$ff       ;  no active drive now
106
+        sta  cdrive      
107
+
108
+        lda  #0         ;  drive inactive
109
+        sta  drvst      ;  clear on bit and timout
110
+        beq  8$	
111
+
112
+11$	tya     	;  test if step needed
113
+        and  #$40        
114
+        bne  13$	;  stepping
115
+
116
+        jmp  10$
117
+
118
+13$	lda  nxtst      ; step or settle
119
+        bne  18$	; go set
120
+
121
+	lda  steps       
122
+        beq  17$
123
+
124
+6$      lda  steps       
125
+        bpl  14$
126
+
127
+	tya
128
+	pha		; save regs .y
129
+	ldy  #99	; wait for trk_00
130
+15$	lda  pota1	; check for trk_00
131
+	ror  a		; rotate into carry
132
+	php		; save it
133
+	lda  pota1	; debounce it
134
+	ror  a		; => carry
135
+	ror  a		; => bit 7
136
+	plp		; restore carry
137
+	and  #$80	; set/clear sign bit
138
+	bcc  21$	
139
+
140
+	bpl  16$	; carry set(off) & sign clear(on) exit
141
+
142
+	bmi  20$	; bra
143
+
144
+21$	bmi  16$	; carry clear(on) & sign set(off) exit
145
+ 
146
+20$	dey 
147
+	bne  15$	; wait a while 
148
+
149
+	bcs  16$	; br, not track 00 ?
150
+
151
+	lda  adrsed	; enable/disable track 00 sense
152
+	bne  16$	; br, nope...
153
+
154
+	lda  dskcnt	; phase 0
155
+	and  #3
156
+	bne  16$
157
+
158
+	pla
159
+	tay		; restore .y
160
+
161
+	lda  #0
162
+	sta  steps	; nomore steps
163
+	jmp  10$
164
+
165
+16$	pla
166
+	tay		; restore .y
167
+
168
+	inc  steps      ; keep stepping
169
+        lda  dskcnt
170
+        sec      
171
+        sbc  #1        	; -1 to step out
172
+        jmp  19$
173
+
174
+17$	lda  #2         ;  settle time
175
+        sta  acltim      
176
+        sta  nxtst      ; show set status
177
+        jmp  10$
178
+
179
+18$	dec  acltim      
180
+        bne  10$
181
+
182
+        lda  drvst       
183
+        and  #$ff-$40    
184
+        sta  drvst       
185
+
186
+        lda  #00         
187
+        sta  nxtst       
188
+        jmp  10$
189
+
190
+14$	dec  steps       
191
+        lda  dskcnt
192
+        clc      
193
+        adc  #01         
194
+
195
+19$	and  #3          
196
+        sta  tmp         
197
+        lda  dskcnt
198
+        and  #$ff-$03   ;  mask out old
199
+        ora  tmp
200
+        sta  dskcnt
201
+
202
+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 @@
1
+        .page  
2
+	.subttl 'mfmsubr1.src'
3
+
4
+; format track
5
+
6
+cmdsev  lda  #$f8	; write track
7
+	jsr  strtwd	; send command
8
+
9
+	bit  switch	; system 34 / iso standard switch
10
+	bvc  no_ind	; write index ?
11
+
12
+	ldx  #80
13
+	WDTEST		; chk address
14
+2$      lda  wdstat
15
+	and  #3
16
+	lsr  a
17
+	bcc  v6
18
+	beq  2$
19
+
20
+	lda  #$4e
21
+	sta  wddat	; give him the data
22
+	dex
23
+	bne  2$
24
+
25
+	ldx  #12
26
+	WDTEST		; chk address
27
+3$	lda  wdstat
28
+	and  #3
29
+	lsr  a
30
+	bcc  v6
31
+	beq  3$
32
+
33
+	lda  #0
34
+	sta  wddat
35
+	dex
36
+	bne  3$
37
+
38
+	ldx  #3
39
+	WDTEST		; chk address
40
+4$	lda  wdstat
41
+	and  #3
42
+	lsr  a
43
+	bcc  v6
44
+	beq  4$
45
+
46
+	lda  #$f6
47
+	sta  wddat
48
+	dex
49
+	bne  4$
50
+
51
+	WDTEST		; chk address
52
+5$	lda  wdstat
53
+	and  #3
54
+	lsr  a
55
+	bcc  v6
56
+	beq  5$
57
+
58
+	lda  #$fc
59
+	sta  wddat
60
+
61
+
62
+	ldx  #50
63
+	WDTEST		; chk address
64
+6$      lda  wdstat
65
+	and  #3
66
+	lsr  a
67
+	bcc  v6
68
+	beq  6$
69
+
70
+	lda  #$4e
71
+	sta  wddat	; give him the data
72
+	dex
73
+	bne  6$
74
+
75
+	beq  inner	; bra... done...
76
+
77
+
78
+no_ind	ldx  #60
79
+	WDTEST		; chk address
80
+cmd7    lda  wdstat
81
+	and  #3
82
+	lsr  a
83
+v6	bcc  v1	
84
+	beq  cmd7
85
+
86
+	lda  #$4e
87
+	sta  wddat	; give him the data
88
+	dex
89
+	bne  cmd7
90
+
91
+
92
+inner	ldy  #1  	; ss
93
+
94
+main7	ldx  #12
95
+	WDTEST		; chk address
96
+cmd70   lda  wdstat
97
+	and  #3
98
+	lsr  a
99
+	bcc  v1	
100
+	beq  cmd70
101
+
102
+	lda  #0
103
+	sta  wddat
104
+	dex
105
+	bne  cmd70
106
+
107
+	ldx  #3
108
+	WDTEST		; chk address
109
+cmd71   lda  wdstat
110
+	and  #3
111
+	lsr  a
112
+v1	bcc  v2	
113
+	beq  cmd71
114
+
115
+	lda  #$f5
116
+	sta  wddat
117
+	dex
118
+	bne  cmd71
119
+
120
+
121
+	WDTEST		; chk address
122
+cmd7n   lda  wdstat
123
+	and  #3
124
+	lsr  a
125
+	bcc  v2	
126
+	beq  cmd7n
127
+
128
+	lda  #$fe   	; id address mark
129
+	sta  wddat
130
+
131
+
132
+	WDTEST		; chk address
133
+cmd7f   lda  wdstat
134
+	and  #3
135
+	lsr  a
136
+	bcc  v2	
137
+	beq  cmd7f
138
+
139
+	lda  mfmcmd	; give him the track
140
+	sta  wddat
141
+
142
+	WDTEST		; chk address
143
+cmd7e   lda  wdstat
144
+	and  #3
145
+	lsr  a
146
+	bcc  v2	
147
+	beq  cmd7e
148
+	
149
+	lda  switch
150
+	and  #%00010000 ; what side are we on ?
151
+	bne  1$
152
+
153
+	lda  #0
154
+	.byte skip2
155
+1$	lda  #1
156
+	sta  wddat	; side number is ...
157
+	
158
+	WDTEST		; chk address
159
+cmd7d   lda  wdstat
160
+	and  #3
161
+	lsr  a
162
+	bcc  v2	
163
+	beq  cmd7d
164
+	
165
+	lda  cmdbuf+10,y ; sector number actually cmdbuf+11
166
+	sta  wddat
167
+
168
+	WDTEST		; chk address
169
+cmd7c   lda  wdstat
170
+	and  #3
171
+	lsr  a
172
+v2	bcc  v3
173
+	beq  cmd7c
174
+
175
+	lda  cmdbuf+5	; sz
176
+	sta  wddat
177
+	
178
+	WDTEST		; chk address
179
+cmd7b   lda  wdstat
180
+	and  #3
181
+	lsr  a
182
+	bcc  v3
183
+	beq  cmd7b
184
+
185
+	lda  #$f7	; crc 2 bytes written
186
+	sta  wddat
187
+
188
+	ldx  #22
189
+
190
+	WDTEST		; chk address
191
+cmd72   lda  wdstat
192
+	and  #3
193
+	lsr  a
194
+	bcc  v3
195
+	beq  cmd72
196
+
197
+
198
+	lda  #$4e
199
+	sta  wddat
200
+	dex
201
+	bne  cmd72
202
+
203
+	ldx  #12
204
+
205
+	WDTEST		; chk address
206
+cmd73   lda  wdstat
207
+	and  #3
208
+	lsr  a
209
+v3	bcc  v4
210
+	beq  cmd73
211
+
212
+
213
+
214
+	lda  #0
215
+	sta  wddat
216
+	dex
217
+	bne  cmd73
218
+
219
+	ldx  #3
220
+	WDTEST		; chk address
221
+cmd74   lda  wdstat
222
+	and  #3
223
+	lsr  a
224
+	bcc  v4
225
+	beq  cmd74
226
+
227
+
228
+	lda  #$f5	; a1
229
+	sta  wddat
230
+	dex
231
+	bne  cmd74
232
+
233
+	WDTEST		; chk address
234
+cmd7a   lda  wdstat
235
+	and  #3
236
+	lsr  a
237
+	bcc  v4
238
+	beq  cmd7a
239
+
240
+	lda  #$fb	; dam
241
+	sta  wddat
242
+	
243
+	sty  temp	; save current sector
244
+
245
+
246
+	ldy  mfmsiz_hi	; high
247
+	WDTEST		; chk address
248
+cmd750  lda  wdstat
249
+	and  #3
250
+	lsr  a
251
+v4	bcc  v5
252
+	beq  cmd750
253
+
254
+
255
+	lda  cmdbuf+10  ; fl
256
+	sta  wddat
257
+	
258
+	cpx  mfmsiz_lo
259
+	beq  cmd75x
260
+
261
+	inx		; increment
262
+	jmp  cmd750
263
+	
264
+cmd75x	inx
265
+	dey
266
+	bne  cmd750
267
+
268
+
269
+	WDTEST		; chk address
270
+cmd7ff  lda  wdstat
271
+	and  #3
272
+	lsr  a
273
+	bcc  v5
274
+	beq  cmd7ff
275
+
276
+	lda  #$f7	; crc
277
+	sta  wddat
278
+	
279
+	ldy  cmdbuf+5	; ss
280
+	lda  gapmfm,y
281
+	ldy  temp	; sector restore
282
+	tax
283
+
284
+	WDTEST		; chk address
285
+cmd7fe  lda  wdstat
286
+	and  #3
287
+	lsr  a
288
+	bcc  v5
289
+	beq  cmd7fe
290
+
291
+	lda  #$4e	; gap 3
292
+	sta  wddat
293
+	dex
294
+	bne  cmd7fe
295
+
296
+	cpy  cmdbuf+7	; ns
297
+	beq  finmfm
298
+
299
+	iny		; inc sector
300
+	jmp  main7
301
+
302
+
303
+	WDTEST		; chk address
304
+finmfm  lda  wdstat
305
+	and  #3
306
+	lsr  a
307
+	bcc  vfin
308
+	beq  finmfm
309
+
310
+	clc
311
+	lda  #$4e	; wait for wd to time out
312
+	sta  wddat
313
+	jmp  finmfm
314
+
315
+vfin    jsr  waitdn	; wait for sleepy time
316
+	clc		; good carry
317
+        .byte skip1
318
+v5     	sec
319
+	rts
320
+
321
+	; min gap size @2% fast
322
+gapmfm 	.byte 7, 12, 23, 44 
323
+	
324
+numsek  .byte 26, 16, 9, 5
325
+
326
+	.page
327
+; format disk
328
+
329
+;  0     1    2    3      4    5    6    7    8   9   10  + cmdbuf
330
+;  ^     ^    ^    ^      ^    ^    ^    ^    ^   ^    ^
331
+; "U" + $00 + N +  MD  + CP + SZ + LT + NS + ST + S + FL 
332
+
333
+cmdeig  lda  switch	; check abort command switch
334
+	and  #%00001000
335
+	beq  1$
336
+
337
+	ldx  ctl_dat	; get error
338
+	stx  mfmcmd	; save for prcmd
339
+	sec		; wp error usually
340
+	rts
341
+
342
+1$	jsr  clrchn	; close all channels
343
+	lda  cmdsiz	; setup default parms
344
+	sec
345
+	sbc  #4		; less mandatory + 1
346
+	tay
347
+	beq  cp00	; mode only, gave cp
348
+	
349
+	dey
350
+	beq  sz00	; md, cp only, gave sz
351
+
352
+	lda  #0
353
+	sta  mfmcmd	; clear status
354
+
355
+	lda  cmdbuf+5
356
+	jsr  consek	; setup sector size
357
+	
358
+	dey
359
+	beq  lt00	; md, cp, sz only, gave lt
360
+
361
+	dey
362
+	beq  ns00	; md, cp, sz, lt only, gave ns
363
+	
364
+	dey
365
+ 	beq  st00       ; md, cp, sz, lt, ns only, gave st
366
+
367
+	dey
368
+	beq  s00        ; md, cp, sz, lt, ns, st only, gave s
369
+
370
+	dey
371
+	beq  fl00	; md, cp, sz, lt, ns, st, ss only, gave fl
372
+
373
+	jmp  start8
374
+
375
+	.page
376
+cp00	lda  #0		; default interleave
377
+	sta  cmdbuf+4	
378
+
379
+sz00	lda  #0
380
+	sta  mfmcmd	; clear status
381
+
382
+	lda  #1		; 256 byte sectors
383
+	sta  cmdbuf+5
384
+	jsr  consek	; setup block size
385
+
386
+lt00	lda  #39	; last track is #39, 40 tracks total
387
+	sta  cmdbuf+6
388
+
389
+ns00	lda  numsek,x	; x=sector size index for # of sectors per track
390
+	sta  cmdbuf+7
391
+
392
+st00	lda  #0		; default track #0 start
393
+	sta  cmdbuf+8
394
+	sta  wdtrk
395
+
396
+s00	lda  #0		; default steps from track 00
397
+	sta  cmdbuf+9
398
+
399
+fl00	lda  #$e5	; default block fill
400
+	sta  cmdbuf+10
401
+
402
+	.page
403
+start8  jsr  go_fmt	; format side zero
404
+	lda  mfmcmd	; error ?
405
+	cpx  #2
406
+	bcs  1$
407
+
408
+	lda  switch	; check for double sided opt
409
+	and  #%00100000
410
+	beq  1$
411
+
412
+	lda  switch	; set single side
413
+	ora  #%00010000
414
+	sta  switch
415
+	jsr  sel_sid	; select h/w
416
+	jsr  go_fmt	; format side one
417
+1$	jmp  cmdone	; restore
418
+
419
+	.page
420
+go_fmt	jsr  diskin	; is there a diskette in the unit
421
+	bcs  c_801	; br, nope...
422
+
423
+	lda  #1	
424
+	sta  ifr1	; clear irq from write protect
425
+	jsr  cmdone     ; restore to track one/zero ?
426
+	lda  cmdbuf+8   ; store logical
427
+	sta  mfmcmd	; in mfmcmd
428
+	sta  wdtrk
429
+
430
+	bit  cmdbuf+3	; check table bit
431
+	bvs  1$		; br, table has been given to us
432
+
433
+	jsr  sectcv	; generate sector table
434
+	bcs  c_801
435
+
436
+1$	lda  cmdbuf+9	; offset track 00 by s steps
437
+	and  #$7f	; clear mode bit
438
+	beq  c_800
439
+
440
+	clc
441
+	adc  cmd_trk	; add to it	
442
+	sta  cmd_trk	; physical
443
+	jsr  seke	; & seek to it
444
+
445
+c_800	sei
446
+	lda  ifr1	; check for disk change
447
+	lsr  a
448
+	bcs  c_801
449
+
450
+	jsr  cmdsev     ; format track
451
+        bcs  c_801      
452
+
453
+	lda  ifr1	; check for disk change
454
+	lsr  a
455
+	bcs  c_801
456
+
457
+	jsr  verfmt	; verify format 
458
+        bcs  c_801      
459
+
460
+	lda  ifr1	; check for disk change
461
+	lsr  a
462
+	bcs  c_801
463
+
464
+        lda  mfmcmd	; last track ?
465
+        cmp  cmdbuf+6   ; lt
466
+        beq  c_802      
467
+
468
+        inc  cmd_trk
469
+	inc  wdtrk
470
+	inc  mfmcmd	; track to write
471
+
472
+        jsr  seke       ; goto next track
473
+        jmp  c_800
474
+
475
+c_802   bit  switch
476
+	bpl c_803	; kill next
477
+
478
+	sec
479
+	lda  cmdbuf+6	; lt
480
+	sbc  cmdbuf+8	; st
481
+	cmp  #39	; no more than 40 tracks
482
+	bcs  c_803
483
+	
484
+	inc  cmd_trk	; clear next track
485
+	jsr  seke
486
+	ldx  #28
487
+	jsr  jclear	; with gcr 0
488
+	jsr  kill	; read mode again
489
+c_803	ldx  #0
490
+	.byte  skip2
491
+c_801   ldx  #6
492
+	stx  mfmcmd	; ok exit
493
+	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 @@
1
+	.page
2
+	.subttl 'romsf.src'
3
+*=rom           	; +$300 rom patch area
4
+cchksm   .byte  $ff	; <<<<< TO BE DETERMINED
5
+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 @@
1
+        .page  
2
+	.subtttl 'seratn1.src'
3
+
4
+jatnsrv sei      
5
+        lda  #0         ; clear pending flag
6
+        sta  atnpnd      
7
+        sta  lsnact     ; clear address flags
8
+        sta  tlkact      
9
+        ldx  #topwrt    ; reset stack
10
+        txs      
11
+	jsr  spinp	
12
+
13
+        lda  #$80       ; set atn mode flag for acpt routine
14
+        sta  eoiflg     ; reset eoi flag to non-eoi state
15
+        sta  atnmod      
16
+
17
+        jsr  clkhi       
18
+        jsr  datlow     ; set data line low as response
19
+
20
+        lda  pb		; set atn ack to release data line
21
+        ora  #atna
22
+	sta  pb
23
+
24
+1$	lda  pb		; test atn still here
25
+        bpl  a2		; gone !
26
+
27
+        and  #clkin     ; clock still low
28
+        bne  1$
29
+
30
+a3	jsr  jacptr+3   ; get a command byte
31
+
32
+	cmp  #unlsn      
33
+        bne  a4
34
+
35
+	lda  fastsr	; clr fast host flag
36
+	and  #$ff-$40
37
+	sta  fastsr
38
+	lda  #0
39
+	sta  lsnact	
40
+        beq  a6		; jmp
41
+
42
+a4	cmp  #untlk      
43
+        bne  a5
44
+
45
+	lda  fastsr	; clr fast host flag
46
+	and  #$ff-$40
47
+	sta  fastsr
48
+        lda  #0          
49
+        sta  tlkact     ; untalk now
50
+
51
+a6	jmp  a9		; jmp
52
+
53
+a5	cmp  tlkadr     ; our talk address?
54
+        bne  a7		; nope
55
+
56
+        lda  #1         ; yes
57
+        sta  tlkact     ; set active talker flag
58
+        lda  #0          
59
+        sta  lsnact     ; unlisten
60
+        beq  a8		; jump
61
+
62
+a7	cmp  lsnadr     ; our listen address?
63
+        bne  a10	; nope
64
+
65
+        lda  #1         ; yes
66
+        sta  lsnact      
67
+        lda  #0          
68
+        sta  tlkact      
69
+        beq  a8		; jump
70
+
71
+a10	tax     	; test if sa
72
+        and  #$60        
73
+        cmp  #$60       ; sa = $60 + n
74
+        bne  a11	; did not get a valid command
75
+
76
+        txa     	; a sa for me
77
+        sta  orgsa       
78
+        and  #$0f       ; strip junk
79
+        sta  sa          
80
+
81
+        lda  orgsa      ; test if close
82
+        and  #$f0        
83
+        cmp  #$e0        
84
+        bne  a9		; no
85
+
86
+        cli      
87
+        jsr  close      ; close the file
88
+        sei      
89
+
90
+;warning:::close doesn't return in time for a9	
91
+
92
+a8	bit  pb		; test atn still here
93
+        bmi  a3
94
+
95
+;atn gone , do what we where told to do
96
+
97
+a2	lda  #0         ; clear atn mode
98
+        sta  atnmod      
99
+
100
+        lda  pb		; atn gone, release atn ack
101
+        and  #$ff-atna   
102
+	sta  pb
103
+
104
+        lda  lsnact     ; listen ?
105
+        beq  a12
106
+
107
+        bit  fastsr     ; fast ?
108
+        bvc  a14
109
+
110
+        jsr  reqfst     ; fast request
111
+a14	jsr  jlisten      
112
+        jmp  xidle       
113
+
114
+a12	lda  tlkact     ; talk?
115
+        beq  a13
116
+
117
+        jsr  dathi      ; release data line
118
+        jsr  clklow      
119
+
120
+        jsr  jslowd     ; slow down for plus4 series
121
+        jsr  jtalk        
122
+        jsr  jslowd     ; slow down for plus4 series
123
+a13	jmp  jilerr     ; release all lines and go to idle
124
+
125
+;fix so (device not present) errors reported
126
+
127
+a11	lda  #$10	; kill all 
128
+	sta  pb
129
+
130
+a9	bit  pb
131
+        bpl  a2		; exit out same way after atn done
132
+
133
+        bmi  a9		; bra
134
+
135
+reqfst  jsr  tstatn     ; does the host want us ?
136
+        jsr  debnc       
137
+        and  #clkin      
138
+        bne  reqfst     ; wait for clk hi
139
+
140
+        jsr  spout      ; output
141
+
142
+        lda  #0          
143
+        sta  sdr	; send zero
144
+
145
+slowb   lda  #8
146
+1$	bit  icr
147
+        beq  1$
148
+
149
+spinp   php		; save uP status
150
+	sei
151
+	lda  cra	; turn 6526 in
152
+        and  #%10111111 ; serial port input
153
+        sta  cra
154
+        lda  pota1	; turn drvr in
155
+        and  #%11111101
156
+	sta  pota1
157
+
158
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
159
+
160
+;	lda  #$84	
161
+	lda  #$88	; *** rom ds 10/07/85 beta9 ***, irq from SP
162
+
163
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
164
+
165
+	sta  icr	; enable irq from serial port
166
+	bit  icr	; clear pending
167
+	plp
168
+	rts      
169
+
170
+spout   php		; save uP status
171
+	sei
172
+	lda  pota1
173
+        ora  #%00000010	; turn drvr out
174
+        sta  pota1
175
+	lda  cra	; turn 6526 out
176
+        ora  #%01000000
177
+        sta  cra
178
+	lda  #8
179
+	sta  icr	; disable irq from serial port
180
+	bit  icr	; clr pending	
181
+	plp
182
+        rts      

+ 114
- 0
DOS_1571_03/serlib.src View File

@@ -0,0 +1,114 @@
1
+	.page 
2
+;*************************************
3
+;
4
+; 1571 DOS 3.0 ROM
5
+;
6
+;*************************************
7
+	.list
8
+        .include  com
9
+	.include  wd1770
10
+        .include  var
11
+	.include  burst
12
+	.include  seratn1
13
+	.include  sertalk1
14
+	.include  serlistn1
15
+        .include  fastutl
16
+        .include  mfmcntrl
17
+        .include  mfmsubr
18
+        .include  mfmsubr1
19
+        .include  mfmsubr2
20
+        .include  mfmsubr3
21
+        .include  utload
22
+        .include  fastld
23
+	.include  signature
24
+        .include  gcrcntrl
25
+        .include  lccseek1
26
+        .include  lccread1
27
+        .include  lccwrt1
28
+        .include  lccgcrbn1
29
+        .include  lccutil1
30
+        .include  lccfmt2a
31
+        .include  lccfmt3a
32
+        .include  lccfmt4a
33
+        .include  irq1541
34
+        .include  irq1571
35
+	.include  gcrtables
36
+        .include  gcrtable1
37
+        .include  gcrtable3
38
+        .include  gcrtable6
39
+        .include  gcrtable8
40
+	.include  duplct1
41
+	.include  patchn
42
+        .include  newvec
43
+	.page
44
+	.subttl '1571 DOS & Controller Routines'
45
+	.page
46
+        .include  romsf      
47
+        .include  leds   
48
+        .include  parsex         
49
+        .include  setdrv         
50
+        .include  lookup         
51
+        .include  trnsfr         
52
+        .include  scrtch         
53
+        .include  duplct         
54
+        .include  copset         
55
+        .include  copall         
56
+        .include  rename         
57
+        .include  memrw          
58
+        .include  block          
59
+        .include  fndrel         
60
+        .include  tst2   
61
+        .include  tst3
62
+        .include  tst4   
63
+        .include  jobssf      
64
+        .include  addfil         
65
+        .include  open   
66
+        .include  close          
67
+        .include  opnchnl         
68
+        .include  tstflg         
69
+        .include  tsutil         
70
+        .include  ssutil         
71
+        .include  sstest         
72
+        .include  getact         
73
+        .include  rel1   
74
+        .include  rel2   
75
+        .include  rel3   
76
+        .include  rel4   
77
+        .include  ssend          
78
+        .include  record         
79
+        .include  nulbuf         
80
+        .include  addrel         
81
+        .include  newss          
82
+        .include  erproc         
83
+        .include  utlodr         
84
+        .include  seratn        
85
+        .include  sertalk       
86
+        .include  serlistn      
87
+        .include  dskintsf      
88
+        .include  idlesf      
89
+        .include  lstdir         
90
+        .include  verdir         
91
+        .include  new    
92
+        .include  map    
93
+        .include  frets
94
+        .include  tstfnd         
95
+        .include  system         
96
+        .include  lccio        
97
+        .include  lccinit       
98
+        .include  lcccntrl      
99
+        .include  lccseek       
100
+        .include  lccread       
101
+        .include  lccwrt        
102
+        .include  lccbingcr     
103
+        .include  lccgcrbin     
104
+        .include  lccconhdr     
105
+        .include  lccutil       
106
+        .include  lccend
107
+        .include  lccfmt1       
108
+        .include  lccfmt2       
109
+        .include  lccfmt3       
110
+        .include  lccfmt4       
111
+        .include  irq    
112
+        .include  romtblsf      
113
+        .include  vector         
114
+	.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 @@
1
+	.page 
2
+	.subttl 'tst2.src'
3
+
4
+;*******************************
5
+;************  l r u i n t  ****
6
+;*******************************
7
+;
8
+; initialize the lru tabel
9
+;
10
+;*******************************
11
+
12
+lruint           
13
+        ldx  #0          
14
+lruilp           
15
+        txa      
16
+        sta  lrutbl,x    
17
+        inx      
18
+        cpx  #cmdchn     
19
+        bne  lruilp      
20
+
21
+        lda  #blindx
22
+        sta  lrutbl,x    
23
+        rts      
24
+
25
+;*******************************
26
+;*************  l r u u p d  ***
27
+;*******************************
28
+
29
+; least recently used table update
30
+
31
+;    input parameters:
32
+;        lindx - current channel
33
+
34
+;    output parameters:
35
+;        lrutbl - updated
36
+
37
+;*******************************
38
+
39
+lruupd  ldy  #cmdchn     
40
+        ldx  lindx       
41
+lrulp1  lda  lrutbl,y    
42
+        stx  lrutbl,y    
43
+        cmp  lindx       
44
+        beq  lruext      
45
+        dey      
46
+        bmi  lruint      
47
+        tax      
48
+        jmp  lrulp1      
49
+lruext  rts      
50
+
51
+;*******************************
52
+;*************  d b l b u f  ***
53
+;*******************************
54
+
55
+; double buffer
56
+; rtn to switch the active and
57
+; inactive buffers
58
+
59
+;*******************************
60
+
61
+dblbuf           
62
+        jsr  lruupd      
63
+        jsr  getina      
64
+        bne  dbl15       
65
+        jsr  setdrn      
66
+        jsr  getbuf      
67
+        bmi  dbl30      ; no buffers
68
+        jsr  putina     ; store inactive buff #
69
+        lda  track       
70
+        pha      
71
+        lda  sector      
72
+        pha      
73
+        lda  #1          
74
+        jsr  drdbyt      
75
+        sta  sector      
76
+        lda  #0          
77
+        jsr  drdbyt      
78
+        sta  track       
79
+
80
+        beq  dbl10       
81
+
82
+        jsr  typfil      
83
+        beq  dbl05      ; it's rel
84
+
85
+        jsr  tstwrt      
86
+        bne  dbl05      ; read ahead
87
+
88
+        jsr  tglbuf     ; just switch on write
89
+        jmp  dbl08       
90
+
91
+dbl05            
92
+        jsr  tglbuf      
93
+        jsr  rdab        
94
+dbl08            
95
+        pla      
96
+        sta  sector      
97
+        pla      
98
+        sta  track       
99
+        jmp  dbl20       
100
+dbl10            
101
+        pla      
102
+        sta  sector      
103
+        pla      
104
+        sta  track       
105
+dbl15   jsr  tglbuf      
106
+dbl20   jsr  getact      
107
+        tax      
108
+        jmp  watjob      
109
+
110
+; there are no buffers to steal
111
+
112
+dbl30            
113
+        lda  #nochnl     
114
+        jmp  cmderr      
115
+
116
+;********************************
117
+
118
+dbset            
119
+        jsr  lruupd      
120
+        jsr  getina      
121
+        bne  dbs10       
122
+        jsr  getbuf      
123
+        bmi  dbl30      ; no buffers
124
+        jsr  putina     ; store inactive buff #
125
+dbs10            
126
+        rts      
127
+;********************************
128
+;************  t g l b u f  *****
129
+;********************************
130
+
131
+; toggle the inactive and active
132
+; buffers.
133
+
134
+;    input parameters:
135
+;        lindx  -  channel #
136
+
137
+;********************************
138
+
139
+tglbuf  ldx  lindx       
140
+        lda  buf0,x      
141
+        eor  #$80        
142
+        sta  buf0,x      
143
+        lda  buf1,x      
144
+        eor  #$80        
145
+        sta  buf1,x      
146
+        rts      
147
+
148
+
149
+pibyte           
150
+        ldx  #iwsa       
151
+        stx  sa          
152
+        jsr  fndwch      
153
+        jsr  setlds      
154
+        jsr  typfil      
155
+        bcc  pbyte       
156
+        lda  #ovrflo     
157
+        jsr  clrflg      
158
+pbyte            
159
+        lda  sa          
160
+        cmp  #15         
161
+        beq  l42         
162
+        bne  l40         
163
+
164
+; main routine to write to chanl
165
+
166
+put     lda  orgsa      ; is chanl cmd or data
167
+        and  #$8f        
168
+        cmp  #15        ; <15 
169
+        bcs  l42         
170
+l40     jsr  typfil     ; data byte to store
171
+        bcs  l41        ; branch if rnd
172
+        lda  data       ; seq file
173
+        jmp  wrtbyt     ; write byte to chanl
174
+l41              
175
+        bne  l46         
176
+        jmp  wrtrel      
177
+l46     lda  data       ; rnd file write
178
+        jsr  putbyt     ; write to chanl
179
+        ldy  lindx      ;  prepare nxt byte
180
+        jmp  rnget2      
181
+l42     lda  #cmdchn    ; write to cmd chanl
182
+        sta  lindx       
183
+        jsr  getpnt     ; test if comm and buffer full
184
+        cmp  #<cmdbuf+cmdlen+1   
185
+        beq  l50        ; it is full (>cmdlen)
186
+        lda  data       ; not full yet
187
+        jsr  putbyt     ; store the byte 
188
+l50     lda  eoiflg     ; tst if lst byte of msg
189
+        beq  l45        ; it is
190
+        rts     	; not yet , return
191
+l45              
192
+        inc  cmdwat     ; set cmd waiting flag
193
+        rts      
194
+
195
+; put .a into active buffer of lindx
196
+
197
+putbyt  pha     	;  save .a
198
+        jsr  getact     ; get active buf#
199
+        bpl  putb1      ; brach if there is one
200
+        pla     	; no buffer error
201
+        lda  #filnop     
202
+        jmp  cmderr     ;  jmp to error routine
203
+putb1   asl  a          ; save the byte in buffer
204
+        tax      
205
+        pla      
206
+        sta  (buftab,x)          
207
+        inc  buftab,x   ;  inc the buffer pointer
208
+        rts     	; z=1 if last char slot in buffer
209
+
210
+; find the active buffer # (lindx)
211
+
212
+
213
+;initialize drives (command)
214
+intdrv  jsr  simprs      
215
+
216
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
217
+
218
+	jsr  ptch73	; *** rom ds 05/20/86 ***
219
+;       jsr  initdr
220
+
221
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
222
+
223
+id20    jmp  endcmd      
224
+
225
+; initialize drive (drvnum)
226
+
227
+itrial           
228
+        jsr  bam2a       
229
+        tay     	; bam lindx from buf0
230
+        ldx  buf0,y      
231
+        cpx  #$ff        
232
+        bne  it30       ; valid buffer #
233
+
234
+        pha     	; save bam-lindx
235
+        jsr  getbuf     ; get a buffer
236
+        tax     	; test it
237
+        bpl  it20       ; no error
238
+
239
+        lda  #nochnl     
240
+
241
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
242
+
243
+;       jsr  cmder3      
244
+	jsr  cmder2	; *** rom ds 1/06/86 beta9 ***, set error
245
+
246
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
247
+it20             
248
+        pla      
249
+        tay     	; restore bam-lindx
250
+        txa      
251
+        ora  #$80       ; set inactive
252
+        sta  buf0,y      
253
+it30             
254
+        txa      
255
+        and  #$f        ; stip to buf #
256
+        sta  jobnum      
257
+        ldx  #0          
258
+        stx  sector      
259
+        ldx  dirtrk      
260
+        stx  track       
261
+        jsr  seth       ; set the bam header
262
+        lda  #seek       
263
+
264
+;<><><><><><><><><><><><><><><><><><><><><><><<><><><><><><><><><>
265
+
266
+	jmp  ptch24	; *** rom ds 02/21/85 ***
267
+;       jmp  dojob      ; do a seek
268
+
269
+;<><><><><><><><><><><><><><><><><><><><><><><<><><><><><><><><><>
270
+
271
+initdr           
272
+        jsr  clnbam      
273
+        jsr  cldchn      
274
+        jsr  itrial      
275
+        ldx  drvnum      
276
+        lda  #0          
277
+        sta  mdirty,x    
278
+        txa      
279
+        asl  a   
280
+        tax      
281
+        lda  header      
282
+        sta  dskid,x     
283
+        lda  header+1    
284
+        sta  dskid+1,x   
285
+
286
+;<><><><><><><><><><><><><><><><><><><><><><><<><><><><><><><><><>
287
+
288
+	jsr  ptch23	; *** rom 02/21/85 ***
289
+; 	jsr  doread
290
+
291
+;<><><><><><><><><><><><><><><><><><><><><><><<><><><><><><><><><>
292
+
293
+	lda  jobnum     
294
+        asl  a   
295
+        tax      
296
+        lda  #2          
297
+        sta  buftab,x    
298
+        lda  (buftab,x)          
299
+        ldx  drvnum      
300
+        sta  dskver,x   ; set up disk version #
301
+
302
+        lda  #0          
303
+
304
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
305
+
306
+	jmp  ptch51	; *** rom ds 05/01/85 ***
307
+	nop		; fill
308
+;       sta  wpsw,x     ; clear wp switch
309
+;       sta  nodrv,x    ; clear not active flag
310
+rtch51			; ret address
311
+
312
+;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
313
+
314
+; count the number of free blocks here
315
+;
316
+nfcalc
317
+	jsr  setbpt      
318
+
319
+        ldy  #4          
320
+        lda  #0          
321
+        tax     	; 0 hi byte
322
+numf1            
323
+        clc      
324
+        adc  (bmpnt),y   
325
+        bcc  numf2       
326
+        inx      
327
+numf2            
328
+        iny      
329
+        iny      
330
+        iny      
331
+        iny      
332
+        cpy  #$48       ;  dont count the dir
333
+        beq  numf2       
334
+        cpy  #$90        
335
+        bne  numf1       
336
+        pha      
337
+        txa      
338
+        ldx  drvnum      
339
+        sta  ndbh,x      
340
+        pla      
341
+
342
+;<><><><><><><><><><><><><><><><><><><><><><><<><><><><><><><><><>
343
+
344
+	jmp  ptch40	; *** rom ds 02/26/85 ****
345
+;       sta  ndbl,x      
346
+        rts      
347
+	
348
+;<><><><><><><><><><><><><><><><><><><><><><><<><><><><><><><><><>
349
+
350
+; start double buffering
351
+; use track,sector as starting block
352
+ 
353
+strrd            
354
+        jsr  sethdr      
355
+        jsr  rdbuf       
356
+        jsr  watjob      
357
+        jsr  getbyt      
358
+        sta  track       
359
+        jsr  getbyt      
360
+        sta  sector      
361
+        rts      
362
+
363
+strdbl           
364
+        jsr  strrd       
365
+        lda  track       
366
+        bne  str1        
367
+        rts      
368
+str1             
369
+        jsr  dblbuf      
370
+        jsr  sethdr      
371
+        jsr  rdbuf       
372
+        jmp  dblbuf      
373
+
374
+; start a read job on track,sector
375
+
376
+rdbuf   lda  #read       
377
+        bne  strtit      
378
+
379
+; start a write job on track,sector
380
+
381
+wrtbuf  lda  #write      
382
+strtit  sta  cmd         
383
+        jsr  getact      
384
+        tax      
385
+        jsr  setljb      
386
+        txa      
387
+        pha      
388
+        asl  a   
389
+        tax      
390
+        lda  #0          
391
+        sta  buftab,x    
392
+        jsr  typfil      
393
+        cmp  #4          
394
+        bcs  wrtc1      ; not sequential type
395
+
396
+        inc  nbkl,x      
397
+        bne  wrtc1       
398
+        inc  nbkh,x      
399
+wrtc1   pla      
400
+        tax      
401
+        rts      
402
+
403
+
404
+;****************************
405
+;*
406
+;*   fndrch
407
+;******************************
408
+;*
409
+;*
410
+fndrch  lda  sa          
411
+        cmp  #maxsa+1    
412
+        bcc  fndc20      
413
+        and  #$f         
414
+fndc20           
415
+        cmp  #cmdsa      
416
+        bne  fndc25      
417
+        lda  #errsa      
418
+fndc25           
419
+        tax      
420
+        sec      
421
+        lda  lintab,x    
422
+        bmi  fndc30      
423
+        and  #$f         
424
+        sta  lindx       
425
+        tax      
426
+        clc      
427
+fndc30  rts      
428
+;*
429
+;*
430
+;*****************************
431
+;*
432
+;*   fndwch
433
+;*
434
+;*****************************
435
+;*
436
+;*
437
+fndwch  lda  sa          
438
+        cmp  #maxsa+1    
439
+        bcc  fndw13      
440
+        and  #$f         
441
+fndw13  tax      
442
+        lda  lintab,x    
443
+        tay      
444
+        asl  a   
445
+        bcc  fndw15      
446
+        bmi  fndw20      
447
+fndw10  tya      
448
+        and  #$0f        
449
+        sta  lindx       
450
+        tax      
451
+        clc      
452
+        rts      
453
+fndw15  bmi  fndw10      
454
+fndw20  sec      
455
+        rts      
456
+
457
+typfil          	; get file type
458
+        ldx  lindx       
459
+        lda  filtyp,x    
460
+        lsr  a   
461
+        and  #7          
462
+        cmp  #reltyp     
463
+        rts      
464
+
465
+getpre  jsr  getact      
466
+        asl  a   
467
+        tax      
468
+        ldy  lindx       
469
+        rts      
470
+
471
+; read byte from active buffer
472
+; and set flag if last data byte
473
+; if last then z=1 else z=0 ;
474
+getbyt  jsr  getpre      
475
+        lda  lstchr,y    
476
+        beq  getb1       
477
+        lda  (buftab,x)          
478
+        pha      
479
+        lda  buftab,x    
480
+        cmp  lstchr,y    
481
+        bne  getb2       
482
+        lda  #$ff        
483
+        sta  buftab,x    
484
+getb2   pla      
485
+        inc  buftab,x    
486
+        rts      
487
+getb1   lda  (buftab,x)          
488
+        inc  buftab,x    
489
+        rts      
490
+
491
+
492
+; read a char from file and read next
493
+; block of file if needed.
494
+; set chnrdy=eoi if end of file
495
+
496
+rdbyt   jsr  getbyt      
497
+        bne  rd3         
498
+        sta  data        
499
+
500
+rd0     lda  lstchr,y    
501
+        beq  rd1         
502
+        lda  #eoiout     
503
+rd01    sta  chnrdy,y    
504
+        lda  data        
505
+        rts      
506
+rd1     jsr  dblbuf      
507
+        lda  #0          
508
+        jsr  setpnt      
509
+        jsr  getbyt      
510
+        cmp  #0          
511
+        beq  rd4         
512
+        sta  track       
513
+        jsr  getbyt      
514
+        sta  sector      
515
+        jsr  dblbuf      
516
+        jsr  setdrn      
517
+        jsr  sethdr      
518
+        jsr  rdbuf       
519
+        jsr  dblbuf      
520
+        lda  data        
521
+rd3     rts      
522
+rd4     jsr  getbyt      
523
+        ldy  lindx       
524
+        sta  lstchr,y    
525
+        lda  data        
526
+        rts      
527
+
528
+
529
+; write a char to chanl and write 
530
+; buffer out to disk if its full
531
+
532
+wrtbyt  jsr  putbyt      
533
+        beq  wrt0        
534
+        rts      
535
+
536
+wrt0    jsr  setdrn      
537
+        jsr  nxtts       
538
+        lda  #0          
539
+        jsr  setpnt      
540
+        lda  track       
541
+        jsr  putbyt      
542
+        lda  sector      
543
+        jsr  putbyt      
544
+        jsr  wrtbuf      
545
+        jsr  dblbuf      
546
+        jsr  sethdr      
547
+        lda  #2          
548
+        jmp  setpnt      
549
+
550
+; inc pointer of active buffer
551
+; by .a
552
+
553
+
554
+incptr          	;  scott patch 
555
+incpnt  sta  temp        
556
+        jsr  getpnt      
557
+        clc      
558
+        adc  temp        
559
+        sta  buftab,x    
560
+        sta  dirbuf      
561
+        rts      
562
+
563
+; set drvnum to drive indicated by
564
+; lstjob of active buffer
565
+
566
+setdrn  jsr  getact      
567
+        tax      
568
+        lda  lstjob,x    
569
+        and  #1          
570
+        sta  drvnum      
571
+        rts      

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


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


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


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


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


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


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


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save