annotate level1/modules/ccio.asm @ 1071:853a796a1bcd

Removed logbook
author boisy
date Mon, 31 Mar 2003 14:10:56 +0000
parents e6dcf1ac92b2
children 4e235f213651
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1 ********************************************************************
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
2 * CCIO - OS-9 Level One V2 CoCo I/O driver
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
3 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
4 * $Id$
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
5 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
6 * Ed. Comments Who YY/MM/DD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
7 * ------------------------------------------------------------------
201
668388823050 Fixed headers to be consistent
boisy
parents: 164
diff changeset
8 * 12 From Tandy OS-9 Level One VR 02.00.00
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
10 nam CCIO
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
11 ttl OS-9 Level One V2 CoCo I/O driver
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
12
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
13 ifp1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
14 use defsfile
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
15 use scfdefs
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
16 endc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
17
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
18 tylg set Drivr+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
19 atrv set ReEnt+rev
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
20 rev set $01
201
668388823050 Fixed headers to be consistent
boisy
parents: 164
diff changeset
21 edition set 12
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
22
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
23 mod eom,name,tylg,atrv,start,size
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
24
257
c93ecc262253 More source enhancements
boisy
parents: 256
diff changeset
25 rmb V.SCF
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
26 u001D rmb 7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
27 u0024 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
28 u0025 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
29 u0026 rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
30 u0028 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
31 u0029 rmb 4
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
32 ScreenX rmb 1
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
33 ScreenY rmb 1
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
34 u002F rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
35 u0030 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
36 u0031 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
37 u0032 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
38 u0033 rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
39 u0035 rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
40 u0037 rmb 9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
41 u0040 rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
42 u0042 rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
43 u0044 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
44 u0045 rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
45 u0047 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
46 u0048 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
47 u0049 rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
48 u004B rmb 5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
49 u0050 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
50 u0051 rmb 1
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
51 WrChar rmb 1
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
52 u0053 rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
53 u0055 rmb 6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
54 u005B rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
55 u005D rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
56 u005F rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
57 u0060 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
58 u0061 rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
59 u0063 rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
60 u0065 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
61 u0066 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
62 u0067 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
63 u0068 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
64 u0069 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
65 u006A rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
66 u006B rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
67 u006C rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
68 u006D rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
69 u006E rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
70 u006F rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
71 u0070 rmb 1
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
72 trulocas rmb 1
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
73 SubEntry rmb 6
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
74 IBufHead rmb 1
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
75 IBufTail rmb 1
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
76 u007A rmb 128
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
77 size equ .
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
78
256
9e9648e17298 Additional source improvements
boisy
parents: 201
diff changeset
79 fcb UPDAT.+EXEC.
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
80
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
81 name fcs /CCIO/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
82 fcb edition
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
83
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
84 start lbra Init
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
85 lbra Read
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
86 lbra Write
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
87 lbra GetStat
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
88 lbra SetStat
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
89 lbra Term
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
90
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
91 * Init
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
92 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
93 * Entry:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
94 * Y = address of device descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
95 * U = address of device memory area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
96 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
97 * Exit:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
98 * CC = carry set on error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
99 * B = error code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
100 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
101 Init stu >D.KbdSta store devmem ptr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
102 clra
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
103 leax <u001D,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
104 ldb #$5D
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
105 L002E sta ,x+ clear mem
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
106 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
107 bne L002E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
108 coma A = $FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
109 comb B = $FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
110 stb <u0050,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
111 std <u005F,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
112 std <u0061,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
113 lda #$3C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
114 sta <u0051,u
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
115 leax >AltIRQ,pcr get IRQ routine ptr
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
116 stx >D.AltIRQ store in AltIRQ
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
117 leax >L03CC,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
118 stx <u005B,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
119 leax >L050F,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
120 stx <u005D,u
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
121 ldd <IT.PAR,y get parity and baud
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
122 lbra L05CE process them
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
123
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
124 * Term
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
125 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
126 * Entry:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
127 * U = address of device memory area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
128 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
129 * Exit:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
130 * CC = carry set on error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
131 * B = error code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
132 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
133 Term pshs cc
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
134 orcc #IRQMask mask interrupts
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
135 ldx >D.Clock get clock vector
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
136 stx >D.AltIRQ and put back in AltIRQ
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
137 puls pc,cc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
138
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
139 * Read
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
140 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
141 * Entry:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
142 * Y = address of path descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
143 * U = address of device memory area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
144 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
145 * Exit:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
146 * A = character read
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
147 * CC = carry set on error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
148 * B = error code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
149 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
150 Read leax <u007A,u
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
151 ldb <IBufTail,u get tail pointer
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
152 orcc #IRQMask mask IRQ
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
153 cmpb <IBufHead,u same as head pointer
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
154 beq Put2Bed if so, buffer is empty, branch to sleep
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
155 abx X now points to curr char
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
156 lda ,x get char
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
157 bsr L009D
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
158 stb <IBufTail,u
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
159 andcc #^(IRQMask+Carry) unmask IRQ
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
160 rts
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
161
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
162 Put2Bed lda V.BUSY,u get calling process ID
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
163 sta V.WAKE,u store in V.WAKE
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
164 andcc #^IRQMask clear interrupts
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
165 ldx #$0000
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
166 os9 F$Sleep sleep forever
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
167 clr V.WAKE,u clear wake
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
168 ldx <D.Proc get pointer to current proc desc
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
169 ldb <P$Signal,x get signal recvd
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
170 beq Read branch if no signal
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
171 cmpb #S$Window window signal?
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
172 bcc Read branch if so
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
173 coma
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
174 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
175 L009D incb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
176 cmpb #$7F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
177 bls L00A3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
178 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
179 L00A3 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
180
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
181 * IRQ routine for keyboard
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
182 AltIRQ ldu >D.KbdSta get keyboard static
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
183 ldb <u0032,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
184 beq L00B7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
185 ldb <u002F,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
186 beq L00B7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
187 lda <u0030,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
188 lbsr L03CC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
189 L00B7 ldx #PIA.U4
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
190 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
191 clrb
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
192 std <u006A,u clear
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
193 bsr L00E8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
194 bne L00CC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
195 clr $02,x
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
196 lda ,x get byte from PIA
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
197 coma complement
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
198 anda #$7F strip off hi bit
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
199 bne L00F1 branch if any bit set
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
200 L00CC clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
201 clrb
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
202 std <u006E,u clear
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
203 coma A = $FF
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
204 tst <u006D,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
205 bne L00DA
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
206 sta <u005F,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
207 L00DA stb <u006D,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
208 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
209 sta <u0060,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
210 std <u0061,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
211 L00E4 jmp [>D.Clock]
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
212 L00E8 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
213 stb $02,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
214 ldb ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
215 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
216 andb #$03
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
217 rts
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
218
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
219 L00F1 bsr L015C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
220 bmi L00CC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
221 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
222 bsr L00E8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
223 bne L00CC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
224 cmpa <u006F,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
225 bne L010E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
226 ldb <u0051,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
227 beq L010A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
228 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
229 L0105 stb <u0051,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
230 bra L00E4
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
231 L010A ldb #$05
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
232 bra L011A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
233 L010E sta <u006F,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
234 ldb #$05
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
235 tst <u006B,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
236 bne L0105
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
237 ldb #$3C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
238 L011A stb <u0051,u
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
239 ldb <IBufHead,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
240 leax <u007A,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
241 abx
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
242 lbsr L009D
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
243 cmpb <IBufTail,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
244 beq L012F
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
245 stb <IBufHead,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
246 L012F sta ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
247 beq L014F
257
c93ecc262253 More source enhancements
boisy
parents: 256
diff changeset
248 cmpa V.PCHR,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
249 bne L013F
257
c93ecc262253 More source enhancements
boisy
parents: 256
diff changeset
250 ldx V.DEV2,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
251 beq L014F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
252 sta $08,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
253 bra L014F
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
254 L013F ldb #S$Intrpt
257
c93ecc262253 More source enhancements
boisy
parents: 256
diff changeset
255 cmpa V.INTR,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
256 beq L014B
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
257 ldb #S$Abort
257
c93ecc262253 More source enhancements
boisy
parents: 256
diff changeset
258 cmpa V.QUIT,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
259 bne L014F
257
c93ecc262253 More source enhancements
boisy
parents: 256
diff changeset
260 L014B lda V.LPRC,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
261 bra L0153
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
262 L014F ldb #S$Wake
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
263 lda V.WAKE,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
264 L0153 beq L0158
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
265 os9 F$Send
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
266 L0158 clr V.WAKE,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
267 bra L00E4
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
268 L015C clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
269 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
270 std <u0066,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
271 std <u0068,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
272 coma
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
273 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
274 std <u0063,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
275 sta <u0065,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
276 deca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
277 sta $02,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
278 L016F lda ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
279 coma
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
280 anda #$7F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
281 beq L0183
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
282 ldb #$FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
283 L0178 incb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
284 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
285 bcc L017F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
286 lbsr L0221
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
287 L017F cmpb #$06
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
288 bcs L0178
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
289 L0183 inc <u0068,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
290 orcc #Carry
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
291 rol $02,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
292 bcs L016F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
293 lbsr L0289
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
294 bmi L020A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
295 cmpa <u005F,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
296 bne L0199
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
297 inc <u006B,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
298 L0199 sta <u005F,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
299 beq L01B9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
300 suba #$1A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
301 bhi L01B9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
302 adda #$1A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
303 ldb <u0067,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
304 bne L01E9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
305 adda #$40
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
306 ldb <u0066,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
307 eorb <u0050,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
308 andb #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
309 bne L01E9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
310 adda #$20
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
311 bra L01E9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
312 L01B9 ldb #$03
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
313 mul
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
314 lda <u0066,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
315 beq L01C4
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
316 incb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
317 bra L01CB
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
318 L01C4 lda <u0067,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
319 beq L01CB
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
320 addb #$02
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
321 L01CB lda <u006C,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
322 beq L01D4
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
323 cmpb #$11
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
324 ble L0208
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
325 L01D4 cmpb #$4C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
326 blt L01DD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
327 inc <u0069,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
328 subb #$06
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
329 L01DD pshs x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
330 leax >L0321,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
331 lda b,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
332 puls x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
333 bmi L01FD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
334 L01E9 ldb <u0069,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
335 beq L01FA
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
336 cmpa #$3F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
337 bls L01F8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
338 cmpa #$5B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
339 bcc L01F8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
340 ora #$20
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
341 L01F8 ora #$80
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
342 L01FA andcc #^Negative
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
343 rts
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
344
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
345 L01FD inc <u006D,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
346 ldb <u006B,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
347 bne L0208
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
348 com <u0050,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
349 L0208 orcc #Negative
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
350 L020A rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
351 L020B pshs b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
352 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
353 orcc #Carry
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
354 inca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
355 L0211 rolb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
356 deca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
357 bne L0211
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
358 bra L0219
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
359 L0217 pshs b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
360 L0219 orb <u006A,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
361 stb <u006A,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
362 puls pc,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
363 L0221 pshs b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
364 cmpb #$03
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
365 bne L0230
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
366 lda <u0068,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
367 cmpa #$03
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
368 blt L0230
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
369 bsr L020B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
370 L0230 lslb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
371 lslb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
372 lslb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
373 addb <u0068,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
374 beq L025D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
375 cmpb #$33
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
376 bne L0243
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
377 inc <u0069,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
378 ldb #$04
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
379 bra L0219
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
380 L0243 cmpb #$31
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
381 beq L024B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
382 cmpb #$34
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
383 bne L0252
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
384 L024B inc <u0067,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
385 ldb #$02
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
386 bra L0219
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
387 L0252 cmpb #$37
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
388 bne L0262
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
389 com <u0066,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
390 ldb #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
391 bra L0219
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
392 L025D ldb #$04
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
393 bsr L0217
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
394 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
395 L0262 pshs x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
396 leax <u0063,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
397 bsr L026D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
398 puls x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
399 puls pc,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
400 L026D pshs a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
401 lda ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
402 bpl L0279
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
403 stb ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
404 ldb #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
405 puls pc,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
406 L0279 lda $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
407 bpl L0283
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
408 stb $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
409 ldb #$02
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
410 puls pc,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
411 L0283 stb $02,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
412 ldb #$03
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
413 puls pc,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
414 L0289 pshs y,x,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
415 bsr L02EE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
416 ldb <u006E,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
417 beq L02C5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
418 leax <u0060,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
419 pshs b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
420 L0297 leay <u0063,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
421 ldb #$03
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
422 lda ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
423 bmi L02B6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
424 L02A0 cmpa ,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
425 bne L02AA
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
426 clr ,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
427 com ,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
428 bra L02B6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
429 L02AA leay $01,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
430 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
431 bne L02A0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
432 lda #$FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
433 sta ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
434 dec <u006E,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
435 L02B6 leax $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
436 dec ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
437 bne L0297
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
438 leas $01,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
439 ldb <u006E,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
440 beq L02C5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
441 bsr L0309
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
442 L02C5 leax <u0063,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
443 lda #$03
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
444 L02CA ldb ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
445 bpl L02DE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
446 deca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
447 bne L02CA
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
448 ldb <u006E,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
449 beq L02EA
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
450 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
451 leax <u0060,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
452 lda b,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
453 bra L02E8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
454 L02DE tfr b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
455 leax <u0060,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
456 bsr L026D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
457 stb <u006E,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
458 L02E8 puls pc,y,x,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
459 L02EA orcc #Negative
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
460 puls pc,y,x,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
461 L02EE ldd <u0066,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
462 bne L0301
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
463 lda #$03
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
464 leax <u0063,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
465 L02F8 ldb ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
466 beq L0302
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
467 leax $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
468 deca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
469 bne L02F8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
470 L0301 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
471 L0302 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
472 stb ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
473 inc <u0069,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
474 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
475 L0309 leax <u0060,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
476 bsr L0314
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
477 leax $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
478 bsr L0314
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
479 leax -$01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
480 L0314 lda ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
481 bpl L0320
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
482 ldb $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
483 bmi L0320
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
484 sta $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
485 stb ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
486 L0320 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
487
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
488 L0321 fcb $00
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
489 fdb $4060,$0c1c,$130a,$1a12,$0818,$1009,$1911
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
490 fdb $2020,$2030,$3081,$3121,$7c32,$2200,$3323,$7e34
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
491 fdb $2400,$3525,$0036,$2600,$3727,$5e38,$285b,$3929
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
492 fdb $5d3a,$2a00,$3b2b,$002c,$3c7b,$2d3d,$5f2e,$3e7d
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
493 fdb $2f3f,$5c0d,$0d0d,$0000,$0005,$031b,$3133,$3532,$3436
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
494
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
495 * Write
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
496 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
497 * Entry:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
498 * A = character to write
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
499 * Y = address of path descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
500 * U = address of device memory area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
501 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
502 * Exit:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
503 * CC = carry set on error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
504 * B = error code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
505 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
506 Write ldb <u0025,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
507 bne L03A3
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
508 sta <WrChar,u
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
509 cmpa #C$SPAC
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
510 bcc L038E
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
511 cmpa #$1E escape sequence
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
512 bcc L03B8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
513 cmpa #$0F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
514 lbcc L063B
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
515 cmpa #C$BELL
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
516 lbeq Ding ring bell
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
517 L038E lda <u0053,u
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
518 L0391 ldb #$03 offset into subroutine
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
519 L0393 leax <SubEntry,u get subroutine entry pointer in X
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
520 ldx a,x
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
521 beq NoIOMod branch if no module
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
522 lda <WrChar,u get character to write
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
523 L039D jmp b,x call i/o subroutine
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
524 NoIOMod comb
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
525 ldb #E$MNF
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
526 rts
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
527
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
528 L03A3 cmpb #$02
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
529 beq L03B0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
530 sta <u0029,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
531 clr <u0025,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
532 jmp [<u0026,u]
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
533 L03B0 sta <u0028,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
534 dec <u0025,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
535 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
536 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
537 L03B8 beq L03C5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
538 leax <L03C7,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
539 L03BD ldb #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
540 L03BF stx <u0026,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
541 stb <u0025,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
542 L03C5 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
543 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
544 L03C7 ldb #$03
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
545 lbra L055F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
546 L03CC pshs x,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
547 stb <u002F,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
548 lda >PIA.U8+2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
549 anda #$07
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
550 ora ,s+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
551 tstb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
552 bne L03DE
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
553 ora <trulocas,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
554 L03DE sta >PIA.U8+2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
555 sta <u0030,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
556 tstb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
557 bne L03F5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
558 stb >$FFC0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
559 stb >$FFC2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
560 stb >$FFC4
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
561 lda <u001D,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
562 bra L0401
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
563 L03F5 stb >$FFC0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
564 stb >$FFC3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
565 stb >$FFC5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
566 lda <u0033,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
567 L0401 ldb #$07
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
568 ldx #$FFC6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
569 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
570 L0407 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
571 bcs L0410
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
572 sta ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
573 leax $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
574 bra L0414
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
575 L0410 leax $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
576 sta ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
577 L0414 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
578 bne L0407
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
579 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
580 puls pc,x
164
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
581
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
582 GRFO fcs /GRFO/
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
583 CO32 fcs /CO32/
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
584 CO80 fcs /CO80/
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
585
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
586 * GetStat
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
587 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
588 * Entry:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
589 * A = function code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
590 * Y = address of path descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
591 * U = address of device memory area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
592 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
593 * Exit:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
594 * CC = carry set on error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
595 * B = error code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
596 *
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
597 GetStat sta <WrChar,u
164
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
598 cmpa #SS.Ready
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
599 bne L0439
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
600 lda <IBufTail,u get buff tail ptr
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
601 suba <IBufHead,u Num of chars ready in A
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
602 lbeq L0660 branch if empty
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
603 SSEOF clrb
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
604 rts
164
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
605 L0439 cmpa #SS.EOF
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
606 beq SSEOF
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
607 ldx PD.RGS,y
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
608 cmpa #SS.Joy
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
609 beq SSJOY
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
610 cmpa #SS.ScSiz
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
611 beq SSSCSIZ
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
612 cmpa #SS.KySns
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
613 beq SSKYSNS
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
614 cmpa #SS.DStat
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
615 lbeq SSDSTAT
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
616 ldb #$06
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
617 lbra L055F
164
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
618
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
619 SSKYSNS ldb <u006A,u get key sense info
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
620 stb R$A,x put in caller's A
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
621 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
622 rts
164
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
623
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
624 SSSCSIZ clra
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
625 ldb <ScreenX,u
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
626 std R$X,x
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
627 ldb <ScreenY,u
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
628 std R$Y,x
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
629 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
630 rts
164
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
631
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
632 * Get joytsick values
164
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
633 SSJOY pshs y,cc
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
634 orcc #IRQMask mask interrupts
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
635 lda #$FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
636 sta >PIA.U4+2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
637 ldb >PIA.U4
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
638 ldy R$X,x get joystick number to poll
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
639 bne L0481
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
640 andb #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
641 bne L0485
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
642 bra L0486
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
643 L0481 andb #$02
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
644 beq L0486
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
645 L0485 clra
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
646 L0486 sta R$A,x
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
647 lda >PIA.U4+3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
648 ora #$08
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
649 ldy R$X,x
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
650 bne L0494
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
651 anda #$F7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
652 L0494 sta >PIA.U4+3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
653 lda >PIA.U4+1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
654 anda #$F7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
655 bsr L04B3
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
656 std R$X,x
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
657 lda >PIA.U4+1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
658 ora #$08
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
659 bsr L04B3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
660 pshs b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
661 ldd #$003F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
662 subd ,s++
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
663 std R$Y,x
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
664 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
665 puls pc,y,cc
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
666
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
667 L04B3 sta >PIA.U4+1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
668 lda #$7F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
669 ldb #$40
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
670 bra L04C7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
671 L04BC lsrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
672 cmpb #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
673 bhi L04C7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
674 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
675 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
676 tfr a,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
677 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
678 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
679 L04C7 pshs b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
680 sta >PIA.U8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
681 tst >PIA.U4
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
682 bpl L04D5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
683 adda ,s+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
684 bra L04BC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
685 L04D5 suba ,s+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
686 bra L04BC
164
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
687
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
688 SSDSTAT lbsr L065B
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
689 bcs L050E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
690 ldd <u0045,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
691 bsr L050F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
692 tfr a,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
693 andb ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
694 L04E7 bita #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
695 bne L04F6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
696 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
697 lsrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
698 tst <u0024,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
699 bmi L04E7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
700 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
701 lsrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
702 bra L04E7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
703 L04F6 pshs b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
704 ldb <u004B,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
705 andb #$FC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
706 orb ,s+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
707 ldx $06,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
708 stb $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
709 ldd <u0045,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
710 std $06,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
711 ldd <u0033,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
712 std $04,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
713 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
714 L050E rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
715 L050F pshs y,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
716 ldb <u0024,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
717 bpl L0517
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
718 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
719 L0517 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
720 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
721 pshs a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
722 ldb #$BF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
723 subb $02,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
724 lda #$20
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
725 mul
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
726 addb ,s+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
727 adca #$00
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
728 ldy <u0033,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
729 leay d,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
730 lda ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
731 sty ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
732 anda <u0044,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
733 ldx <u0042,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
734 lda a,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
735 puls pc,y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
736
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
737 * SetStat
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
738 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
739 * Entry:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
740 * A = function code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
741 * Y = address of path descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
742 * U = address of device memory area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
743 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
744 * Exit:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
745 * CC = carry set on error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
746 * B = error code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
747 *
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
748 SetStat sta <WrChar,u
164
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
749 ldx PD.RGS,y
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
750 cmpa #SS.ComSt
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
751 lbeq SSCOMST
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
752 cmpa #SS.AAGBf
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
753 beq SSAAGBF
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
754 cmpa #SS.SLGBf
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
755 beq SSSLGBF
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
756 cmpa #SS.KySns
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
757 bne L055D
164
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
758 ldd R$X,x
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
759 beq L0558
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
760 ldb #$FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
761 L0558 stb <u006C,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
762 L055B clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
763 L055C rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
764 L055D ldb #$09
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
765 L055F pshs b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
766 lda <u0053,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
767 lbsr L0393
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
768 puls a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
769 bcc L055B
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
770 tst <SubEntry,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
771 beq L055C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
772 tfr a,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
773 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
774 lbra L0393
164
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
775
317
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
776 * Reserve an additional graphics buffer (up to 2)
164
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
777 SSAAGBF ldb <u0031,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
778 lbeq L0660
317
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
779 pshs b get buffer number
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
780 leay <u0037,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
781 ldd ,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
782 beq L058E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
783 leay $02,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
784 inc ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
785 ldd ,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
786 bne L059E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
787 L058E lbsr L0685
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
788 bcs L05A1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
789 std ,y
317
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
790 std R$X,x
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
791 puls b get buffer number off stack
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
792 clra clear hi byte of D
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
793 std R$Y,x and put in caller's Y
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
794 clrb call is ok
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
795 rts and return
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
796 L059E ldb #E$BMode
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
797 coma
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
798 L05A1 puls pc,a
164
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
799
317
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
800 * Select a graphics buffer
164
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
801 SSSLGBF ldb <u0031,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
802 lbeq L0660
317
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
803 ldd R$Y,x get buffer number from caller
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
804 cmpd #$0002 compare against high
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
805 bhi BadMode branch if error
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
806 leay <u0035,u
317
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
807 lslb multiply by 2
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
808 ldd b,y get pointer
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
809 beq BadMode branch if error
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
810 std <u0033,u else save in current
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
811 ldd R$X,x get select flag
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
812 beq L05C3 if zero, do nothing
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
813 ldb #$01 else set display flag
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
814 L05C3 stb <u0032,u save display flag
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
815 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
816 rts
317
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
817 BadMode comb
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
818 ldb #E$BMode
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
819 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
820
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
821 SSCOMST ldd R$Y,x Get caller's Y
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
822 L05CE bita #$02 CO80?
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
823 bne GoCO80 branch if so
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
824 ldb #$10 assume true lower case TRUE
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
825 bita #$01 true lowercase bit set?
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
826 bne GoCO32 branch if so
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
827 clrb true lower case FALSE
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
828 GoCO32 stb <trulocas,u save flag for later
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
829 lda #$02
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
830 ldx #$2010 32x16
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
831 pshs u,y,x,a
164
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
832 leax >CO32,pcr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
833 bra L05F4
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
834 GoCO80 lda #$04
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
835 ldx #$5018 80x24
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
836 pshs u,y,x,a
164
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
837 leax >CO80,pcr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
838 L05F4 bsr L0601
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
839 puls u,y,x,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
840 bcs L0600
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
841 stx <ScreenX,u save screen size
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
842 sta <u0053,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
843 L0600 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
844 L0601 bita <u0070,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
845 beq L0608
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
846 L0606 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
847 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
848 L0608 pshs y,x,a
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
849 lbsr LinkSub
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
850 bcc L061F branch if link was successful
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
851 ldx $01,s get pointer to name on stack
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
852 pshs u
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
853 os9 F$Load try to load subroutine I/O module
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
854 puls u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
855 bcc L061F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
856 puls y,x,a
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
857 lbra NoIOMod
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
858 L061F leax <SubEntry,u
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
859 lda ,s get A off stack
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
860 sty a,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
861 puls y,x,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
862 ldb #$00
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
863 lbra L0393
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
864
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
865 * Link to subroutine
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
866 LinkSub pshs u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
867 lda #Systm+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
868 os9 F$Link
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
869 puls pc,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
870
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
871 L0637 fdb $0055,$aaff
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
872
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
873 L063B cmpa #$15
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
874 bcc L0664
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
875 cmpa #$0F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
876 beq L06B4
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
877 suba #$10
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
878 bsr L065B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
879 bcs L0663
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
880 leax <L0651,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
881 lsla
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
882 ldd a,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
883 jmp d,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
884
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
885 L0651 fdb $0140,$00fd,$0111,$0160,$016f
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
886
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
887 L065B ldb <u0031,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
888 bne L0606
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
889 L0660 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
890 ldb #E$NotRdy
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
891 L0663 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
892 L0664 bsr L065B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
893 bcs L0663
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
894 ldx <SubEntry,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
895 bne L0681
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
896 pshs y,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
897 bne L067F
164
20f0878b4a7f Added more verbosity to source
boisy
parents: 0
diff changeset
898 leax >GRFO,pcr
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
899 bsr LinkSub
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
900 bcc L067B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
901 puls pc,y,a
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
902 L067B sty <SubEntry,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
903 L067F puls y,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
904 L0681 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
905 lbra L0391
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
906 L0685 pshs u
317
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
907 ldd #6144+256
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
908 os9 F$SRqMem
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
909 bcc L0691
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
910 puls pc,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
911 L0691 tfr u,d
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
912 puls u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
913 tfr a,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
914 bita #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
915 beq L069F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
916 adda #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
917 bra L06A1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
918 L069F addb #$18
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
919 L06A1 pshs u,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
920 tfr b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
921 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
922 tfr d,u
317
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
923 ldd #256
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
924 os9 F$SRtMem
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
925 puls u,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
926 bcs L06B3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
927 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
928 L06B3 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
929 L06B4 leax <L06BC,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
930 ldb #$02
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
931 lbra L03BF
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
932
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
933 L06BC ldb <u0031,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
934 bne L06D1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
935 bsr L0685
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
936 bcs L06EF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
937 std <u0033,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
938 std <u0035,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
939 inc <u0031,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
940 lbsr L07B1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
941 L06D1 lda <u0029,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
942 sta <u004B,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
943 anda #$03
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
944 leax >L0637,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
945 lda a,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
946 sta <u0047,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
947 sta <u0048,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
948 lda <u0028,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
949 cmpa #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
950 bls L06F0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
951 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
952 ldb #E$BMode
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
953 L06EF rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
954 L06F0 tsta
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
955 beq L0710
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
956 ldd #$C003
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
957 std <u0049,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
958 lda #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
959 sta <u0024,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
960 lda #$E0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
961 ldb <u0029,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
962 andb #$08
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
963 beq L0709
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
964 lda #$F0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
965 L0709 ldb #$03
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
966 leax <L0742,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
967 bra L072D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
968 L0710 ldd #$8001
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
969 std <u0049,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
970 lda #$FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
971 tst <u0047,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
972 beq L0723
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
973 sta <u0047,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
974 sta <u0048,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
975 L0723 sta <u0024,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
976 lda #$F0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
977 ldb #$07
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
978 leax <L0746,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
979 L072D stb <u0044,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
980 stx <u0042,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
981 ldb <u0029,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
982 andb #$04
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
983 lslb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
984 pshs b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
985 ora ,s+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
986 ldb #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
987 lbra L03CC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
988
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
989 L0742 fcb $c0,$30,$0c,$03
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
990 L0746 fcb $80,$40,$20,$10,$08,$04,$02,$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
991 fcb $30,$8C,$03,$16,$fC,$69,$6f,$C8,$28
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
992 fcb $A6,$C8,$24,$2B,$03,$6C,$C8,$28,$16
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
993 fcb $FF,$6F,$30,$C8,$35,$10,$8E,$00,$00
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
994 fcb $C6,$03,$34,$44
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
995
317
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
996 L076D ldd #6144 size of graphics screen
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
997 ldu ,x++
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
998 beq L077A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
999 sty -$02,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1000 os9 F$SRtMem
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1001 L077A dec ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1002 bgt L076D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1003 ldu ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1004 beq L0788
317
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
1005 ldd #512
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1006 os9 F$SRtMem
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1007 L0788 puls u,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1008 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1009 sta <u0031,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1010 lbra L03CC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1011 leax <L0797,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1012 lbra L03BD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1013 L0797 lda <u0029,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1014 tst <u0024,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1015 bpl L07A7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1016 ldb #$FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1017 anda #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1018 beq L07B1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1019 bra L07B2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1020 L07A7 anda #$03
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1021 leax >L0637,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1022 ldb a,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1023 bra L07B2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1024 L07B1 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1025 L07B2 ldx <u0033,u
317
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
1026 leax >6144+1,x
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1027 L07B9 stb ,-x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1028 cmpx <u0033,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1029 bhi L07B9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1030 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1031 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1032 std <u0045,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1033 rts
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
1034
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
1035 * Ding - tickle CoCo's PIA to emit a sound
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
1036 Ding pshs b,a
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1037 lda >PIA.U4+1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1038 ldb >PIA.U4+3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1039 pshs b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1040 anda #$F7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1041 andb #$F7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1042 sta >PIA.U4+1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1043 stb >PIA.U4+3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1044 lda >PIA.U8+3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1045 pshs a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1046 ora #$08
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1047 sta >PIA.U8+3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1048 ldb #$0A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1049 L07E6 lda #$FE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1050 bsr L0800
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1051 lda #$02
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1052 bsr L0800
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1053 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1054 bne L07E6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1055 puls a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1056 sta >PIA.U8+3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1057 puls b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1058 sta >PIA.U4+1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1059 stb >PIA.U4+3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1060 puls pc,b,a
307
1580bbd1e2fc Added more comments and source symbolics in ccio.asm
boisy
parents: 257
diff changeset
1061
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1062 L0800 sta >PIA.U8
317
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
1063 * some type of settle delay
e6dcf1ac92b2 Modified ccio.asm for better comments, init.asm simplified
boisy
parents: 307
diff changeset
1064 lda #128
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1065 L0805 inca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1066 bne L0805
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1067 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1068
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1069 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1070 eom equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1071 end