228
|
1 ********************************************************************
|
|
2 * GFX - CoCo 2 graphics subroutine module
|
|
3 *
|
|
4 * $Id$
|
|
5 *
|
|
6 * Ed. Comments Who YY/MM/DD
|
|
7 * ------------------------------------------------------------------
|
|
8 * 1 Original Tandy/Microware version
|
|
9
|
|
10 nam GFX
|
|
11 ttl CoCo 2 graphics subroutine module
|
|
12
|
|
13 * Disassembled 98/09/25 21:47:16 by Disasm v1.6 (C) 1988 by RML
|
|
14
|
|
15 ifp1
|
|
16 use defsfile
|
|
17 endc
|
|
18
|
|
19 tylg set Sbrtn+Objct
|
|
20 atrv set ReEnt+rev
|
|
21 rev set $01
|
|
22 edition set 1
|
|
23
|
|
24 mod eom,name,tylg,atrv,start,size
|
|
25 u0000 rmb 0
|
|
26 size equ .
|
|
27
|
|
28 name fcs /GFX/
|
|
29 fcb edition
|
|
30
|
|
31 FuncTbl fdb Alpha-FuncTbl
|
|
32 fcc "Alpha"
|
|
33 fcb $FF
|
|
34 fdb Circle-FuncTbl
|
|
35 fcc "Circle"
|
|
36 fcb $FF
|
|
37 fdb Clear-FuncTbl
|
|
38 fcc "Clear"
|
|
39 fcb $FF
|
|
40 fdb CColor-FuncTbl
|
|
41 fcc "Color"
|
|
42 fcb $FF
|
|
43 fdb GColr-FuncTbl
|
|
44 fcc "GColr"
|
|
45 fcb $FF
|
|
46 fdb GLoc-FuncTbl
|
|
47 fcc "GLoc"
|
|
48 fcb $FF
|
|
49 fdb JoyStk-FuncTbl
|
|
50 fcc "JoyStk"
|
|
51 fcb $FF
|
|
52 fdb Line-FuncTbl
|
|
53 fcc "Line"
|
|
54 fcb $FF
|
|
55 fdb Mode-FuncTbl
|
|
56 fcc "Mode"
|
|
57 fcb $FF
|
|
58 fdb Move-FuncTbl
|
|
59 fcc "Move"
|
|
60 fcb $FF
|
|
61 fdb Point-FuncTbl
|
|
62 fcc "Point"
|
|
63 fcb $FF
|
|
64 fdb Quit-FuncTbl
|
|
65 fcc "Quit"
|
|
66 fcb $FF
|
|
67 fdb $0000
|
|
68
|
|
69 stkdepth set 9
|
|
70
|
|
71 start leas -stkdepth,s
|
|
72 ldd 2+stkdepth,s get parameter count
|
|
73 beq BadFunc
|
|
74 tsta param count greater than 255?
|
|
75 bne BadFunc yep, branch to error
|
|
76 leau >FuncTbl,pcr point to function pointer table
|
|
77 L007D ldy ,u++ get pointer to function
|
|
78 beq NoFunc
|
|
79
|
|
80 * Compare passed function name to our list
|
|
81 ldx 4+stkdepth,s
|
|
82 L0084 lda ,x+ get passed param char
|
|
83 eora ,u+ XOR it with compared param char
|
|
84 anda #$DF make case same
|
|
85 beq L0094 branch if equal
|
|
86 leau -1,u back up one
|
|
87 L008E tst ,u+
|
|
88 bpl L008E
|
|
89 bra L007D
|
|
90 L0094 tst -1,u
|
|
91 bpl L0084
|
|
92 tfr y,d put funcion pointer in D
|
|
93 leay >FuncTbl,pcr point Y to table
|
|
94 leay d,y get function address
|
|
95 leax ,s
|
|
96 leau <$11,s
|
|
97 ldd stkdepth+2,s put parameter count in D
|
|
98 jmp ,y
|
|
99
|
|
100 NoFunc ldb #E$NoRout
|
|
101 bra L00AF
|
|
102 BadFunc ldb #E$ParmEr $38
|
|
103 L00AF coma
|
|
104 leas stkdepth,s
|
|
105 rts
|
|
106
|
|
107 * Each subroutine enters with the following parameters
|
|
108 * B = parameter count
|
|
109 * X = temporary stack
|
|
110 * U = pointer to size of first parameter
|
|
111
|
|
112 Mode lda #$0F
|
|
113 bra L00B9
|
|
114
|
|
115 Move lda #$15
|
|
116 L00B9 cmpb #$03 correct number of params?
|
|
117 bne BadFunc
|
|
118 bra L010B
|
|
119
|
|
120 CColor lda #$11
|
|
121 bra L00DE
|
|
122
|
|
123 Point cmpb #$03 correct number of params?
|
|
124 beq L00D4
|
|
125 cmpb #$04
|
|
126 bne BadFunc
|
|
127 leau <$19,s
|
|
128 lbsr L015E
|
|
129 leau <$11,s
|
|
130 L00D4 lda #$18
|
|
131 bra L010B
|
|
132
|
|
133 Clear cmpb #$01 correct number of params?
|
|
134 beq L00E4
|
|
135 lda #$10
|
|
136 L00DE cmpb #$02
|
|
137 bne BadFunc
|
|
138 bra L0136
|
|
139
|
|
140 L00E4 lda #$13
|
|
141 bra L0142
|
|
142
|
|
143 Line cmpb #$06 correct number of params?
|
|
144 bhi BadFunc
|
|
145 cmpb #$03
|
|
146 bcs L015B
|
|
147 bitb #$01
|
|
148 bne L0103
|
|
149 leau <$19,s
|
|
150 cmpb #$04
|
|
151 beq L00FE
|
|
152 leau <$21,s
|
|
153 L00FE bsr L015E
|
|
154 leau <$11,s
|
|
155 L0103 cmpb #$04
|
|
156 bls L0109
|
|
157 bsr L0164
|
|
158 L0109 lda #$16
|
|
159 L010B sta ,x+
|
|
160 bsr L016E
|
|
161 bsr L016E
|
|
162 bra L0144
|
|
163
|
|
164 Circle cmpb #$05 correct number of params?
|
|
165 bhi L015B
|
|
166 cmpb #$02
|
|
167 bcs L015B
|
|
168 bitb #$01
|
|
169 beq L012E
|
|
170 leau <$15,s
|
|
171 cmpb #$03
|
|
172 beq L0129
|
|
173 leau <$1D,s
|
|
174 L0129 bsr L015E
|
|
175 leau <$11,s
|
|
176 L012E cmpb #$03
|
|
177 bls L0134
|
|
178 bsr L0164
|
|
179 L0134 lda #$1A
|
|
180 L0136 sta ,x+
|
|
181 bsr L016E
|
|
182 bra L0144
|
|
183
|
|
184 Alpha lda #$0E
|
|
185 bra L0142
|
|
186
|
|
187 Quit lda #$12
|
|
188 L0142 sta ,x+
|
|
189 L0144 bsr L0149
|
|
190 leas stkdepth,s
|
|
191 rts
|
|
192
|
|
193 L0149 tfr x,d
|
|
194 leax 2,s
|
|
195 pshs x
|
|
196 subd ,s++
|
|
197 tfr d,y
|
|
198 lda #1
|
|
199 os9 I$Write
|
|
200 rts
|
|
201
|
|
202 L0159 leas $06,s
|
|
203 L015B lbra BadFunc
|
|
204 L015E lda #$11
|
|
205 sta ,x+
|
|
206 bra L016E
|
|
207 L0164 puls y
|
|
208 lda #$15
|
|
209 sta ,x+
|
|
210 bsr L016E
|
|
211 pshs y
|
|
212 L016E pshs y,b,a
|
|
213 ldd [,u++]
|
|
214 sta ,x+
|
|
215 pulu y
|
|
216 leay -$01,y
|
|
217 beq L0183
|
|
218 leay -$01,y
|
|
219 bne L0159
|
|
220 tsta
|
|
221 bne L0159
|
|
222 stb -$01,x
|
|
223 L0183 puls pc,y,b,a
|
|
224
|
|
225 GLoc cmpb #$02 correct number of params?
|
|
226 bne L015B
|
|
227 ldx <$13,s
|
|
228 leax -$02,x
|
|
229 bne L015B
|
|
230 lda #1 standard out
|
|
231 ldb #SS.DStat
|
|
232 os9 I$GetStt
|
|
233 bcs L019C
|
|
234 stx [<$11,s]
|
|
235 L019C leas stkdepth,s
|
|
236 rts
|
|
237
|
|
238 GColr cmpb #2 correct number of params?
|
|
239 beq L01AD
|
|
240 cmpb #$04
|
|
241 bne L015B
|
|
242 bsr L0164
|
|
243 bsr L0149
|
|
244 bcs L019C
|
|
245 L01AD lda #$01
|
|
246 ldb #$12
|
|
247 os9 I$GetStt
|
|
248 bcs L019C
|
|
249 tfr a,b
|
|
250 bra L01ED
|
|
251 L01BA leau $04,u
|
|
252 pshs u,x
|
|
253 ldx -$02,u
|
|
254 ldu -$04,u
|
|
255 leax -$01,x
|
|
256 beq L01CC
|
|
257 leax -$01,x
|
|
258 bne L0159
|
|
259 clr ,u+
|
|
260 L01CC stb ,u+
|
|
261 puls pc,u,x
|
|
262
|
|
263 JoyStk cmpb #5 correct number of params?
|
|
264 bne L015B
|
|
265 clr ,x+
|
|
266 bsr L016E
|
|
267 ldx -2,x
|
|
268 lda #1
|
|
269 ldb #SS.Joy
|
|
270 os9 I$GetStt
|
|
271 bcs L019C
|
|
272 tfr a,b
|
|
273 bsr L01BA
|
|
274 tfr x,d
|
|
275 bsr L01BA
|
|
276 tfr y,d
|
|
277 L01ED bsr L01BA
|
|
278 leas stkdepth,s
|
|
279 rts
|
|
280
|
|
281 emod
|
|
282 eom equ *
|
|
283 end
|