-
Notifications
You must be signed in to change notification settings - Fork 85
/
duplct
169 lines (169 loc) · 1.91 KB
/
duplct
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
.PAGE 'DUPLICATE'
;
; DUPLICATE DISK
;
DUPLCT
JSR PRSEQ
LDA FILDRV+1
STA DRVNUM
LDA #LED0+LED1
ORA PBD2
STA PBD2
JSR INITDR ; INIT SRC
JSR SETBMP
LDY #2
LDA (BMPNT),Y
CMP VERNUM
BEQ DUP1
JMP VNERR
DUP1
JSR TOGDRV
ASL A
TAY
EOR #2
TAX
LDA DSKID,X
STA DSKID,Y
LDA DSKID+1,X
STA DSKID+1,Y
JSR SETBMP
LDY #2
LDA VERNUM
STA (BMPNT),Y
JSR CLDCHN
LDX #1
STX TRACK
JSR FORMAT ; FORMAT DST DRIVE
;
; COPY BLOCKS FROM ONE DRIVE TO OTHER
;
CPYD1
LDA TRACK
JSR MAXSEC
STA SECTOR
DEC SECTOR
JSR CPYTRK ; COPY ONE TRACK
INC TRACK
LDA TRACK
CMP MAXTRK
BNE CPYD1
JSR INITDR
JMP ENDCMD
;
; COPY ONE TRACK
;
CPYTRK
JSR SETRH
JSR READS ; READ 10 SECTORS
JSR WRITES ; WRITE 10 SECTORS
LDA SECTOR
BPL CPYTRK
RTS
SETRH
LDA DRVNUM
EOR #1
STA CMD
SETR5
LDA #10
STA TEMP+2
SETR3
LDA TEMP+2
JSR SETH
DEC SECTOR
BMI SETR6
DEC TEMP+2
BPL SETR3
INC TEMP+2
SETR6
RTS
;
; READ TEMP+2 BLOCKS IN
;
READS
LDA CMD
ORA #READ
STA CMD
LDX TEMP+2
READS1
LDA CMD
JSR SETJOB
CPX #10
BEQ READS8
INX
BNE READS1
READS8
LDX TEMP+2
READS3
JSR WATJOB
READ10
CPX #10
BEQ READ15
INX
BNE READS3
READ15
RTS
;
; WRITE TEMP+2 BUFFERS OUT
;
WRITES
LDA #WRITE
ORA DRVNUM
STA CMD
LDX TEMP+2
WRIT0
JSR SETJOB
WRIT30
CPX #10
BEQ WRIT5
INX
BNE WRIT0
WRIT5
LDX TEMP+2
WRIT10
JSR WATJOB
WRIT15
CPX #10
BEQ WRIT20
INX
BNE WRIT10
WRIT20
RTS
;
; TRANSFER FORMAT CODE TO BUFFER 0
; & START CONTROLLER FORMATTING
;
FORMAT
LDY #0
;
; TRANSFER FORMAT CODE
;
FORMA1
LDA FMTCOD,Y
STA VBAMS,Y
LDA FMTCOD+$100,Y
STA VBAMS+$100,Y
LDA FMTCOD+$200,Y
STA VBAMS+$200,Y
LDA FMTCOD+$300,Y
STA VBAMS+$300,Y
INY
BNE FORMA1
STY FMTDAT ; FORMAT DATA, .Y = 0
INY
STY FMTTRK ; STARTING FORMAT TRACK
LDY TLGAP
STY MAXGAP ; MAX TAIL GAP
LDA #0
JSR SETH
LDA DRVNUM
ORA #EXEC
STA JOBS
FMT105
LDA JOBS
BMI FMT105
CMP #1
BEQ FMT110
LDX #0 ; JOB # 0
JMP ERROR
FMT110
RTS