-
Notifications
You must be signed in to change notification settings - Fork 85
/
utload.src
162 lines (126 loc) · 2.48 KB
/
utload.src
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
.page
.subttl 'utload.src'
;***************************
;** **
;** 1571 UTILITY **
;** **
;** * * * * * * * * * * * **
;** U0 n M = mode **
;** U0 n S = int. dos **
;** U0 n R = retries **
;** U0 n H = head 0,1 **
;** U0 n T = signature **
;** U0 n V = verify **
;** U0 n # = device **
;** **
;** n = ">" ascii **
;** **
;***************************
cmdsec lda cmdbuf+4
sta secinc
rts
cmdret lda cmdbuf+4
sta revcnt
rts
sign jmp signature ; finish up there
heads sei ; no irq's
lda pota1
and #$20
bne utlbad ; 1541 only
lda cmdbuf+4 ; which ?
cmp #'1
beq 1$
cmp #'0
bne utlbad ; no drive # specified
lda pota1 ; 1541 mode
and #$ff-$04 ; side 0
sta pota1
cli
bit switch
bpl 2$
rts
1$ lda pota1
ora #$04
sta pota1 ; side 1
cli
bit switch
bmi 3$
2$ jmp initdr
3$ rts
chgutl ldx cmdsiz ; chk cmd size
cpx #4
bcc utlbad ; br, error no parameters
lda cmdbuf+3
cmp #'S ; sector interleave ?
beq cmdsec
cmp #'R ; retry
beq cmdret
cmp #'T ; test ROM
beq sign
cmp #'M ; 1571/1541 Mode
beq modes
cmp #'H ; 1541 head change
beq heads
;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
; tay ; save
; cpy #4 ; between 4-30
jmp ptch61 ; *** rom ds 01/21/86 ***, chk for verify
rtch61
;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
bcc utlbad
cpy #31
bcs utlbad
lda #$40 ; change device #
sta tlkadr ; clear old
lda #$20
sta lsnadr ; *
tya
clc
adc tlkadr
sta tlkadr ; new
tya
clc
adc lsnadr
sta lsnadr ; new
rts
utlbad lda #badcmd
jmp cmderr
modes sei ; no irq's
lda cmdbuf+4 ; which ?
cmp #'1
beq 1$
cmp #'0
bne utlbad ; br, bad
lda pota1 ; 1541 mode
and #$ff-$20 ; 1Mhz
sta pota1
jsr jslowd ; wait a while
jsr ptch10 ; init
lda lock
ora #$80
sta lock ; auto off
cli
bit switch
bpl 2$
rts
1$ lda pota1 ; 1571 mode
ora #$20
sta pota1 ; 2 Mhz
jsr jslowd ; wait a bit
lda #<jirq
sta irqjmp ; revector irq
lda #>jirq
sta irqjmp+1
lda #tim2 ; setup timers
sta t1hl2
sta t1hc2 ; for 2 Mhz
lda lock
and #$ff-$80
sta lock ; auto on
lda #0
sta nxtst ; used as a pointer in 1541 mode
cli
bit switch
bmi 3$
2$ jmp initdr
3$ rts