Mercurial > hg > Members > kono > nitros9-code
annotate level1/cmds/grfo.asm @ 1912:37fd74e6fad8
Now assembles with rma, uses os9defs.d in c3
author | boisy |
---|---|
date | Fri, 11 Nov 2005 12:41:12 +0000 |
parents | 5f18094d961d |
children |
rev | line source |
---|---|
26 | 1 ******************************************************************** |
2 * GRFO - Graphics module | |
3 * | |
4 * $Id$ | |
5 * | |
1325
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
924
diff
changeset
|
6 * Edt/Rev YYYY/MM/DD Modified by |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
924
diff
changeset
|
7 * Comment |
26 | 8 * ------------------------------------------------------------------ |
1325
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
924
diff
changeset
|
9 * 1 ????/??/?? |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
924
diff
changeset
|
10 * From Tandy OS-9 Level One VR 02.00.00. |
26 | 11 |
21 | 12 nam GRFO |
13 ttl Graphics module | |
14 | |
15 * Disassembled 02/04/05 23:44:21 by Disasm v1.6 (C) 1988 by RML | |
16 | |
17 ifp1 | |
18 use defsfile | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
19 use cciodefs |
21 | 20 endc |
21 | |
22 tylg set Systm+Objct | |
23 atrv set ReEnt+rev | |
1325
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
924
diff
changeset
|
24 rev set $00 |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
26
diff
changeset
|
25 edition set 1 |
21 | 26 |
27 mod eom,name,tylg,atrv,start,size | |
28 | |
924 | 29 org 0 |
21 | 30 size equ . |
31 | |
32 fcb $07 | |
33 name fcs /GRFO/ | |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
26
diff
changeset
|
34 fcb edition |
21 | 35 |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
36 * Dispatch table |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
37 start lbra Init |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
38 lbra Write |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
39 lbra GetStat |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
40 lbra SetStat |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
41 lbra Term |
21 | 42 |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
43 * 128x192 4 color pixel table |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
44 Mode1Clr fdb $0055,$aaff |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
45 |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
46 GetStat |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
47 SetStat comb |
26 | 48 ldb #E$UnkSvc |
49 rts | |
50 | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
51 Write suba #$15 |
26 | 52 leax <Table,pcr |
53 lsla | |
54 ldd a,x | |
55 jmp d,x | |
56 | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
57 Table fdb Do15-Table |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
58 fdb Do16-Table |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
59 fdb Do17-Table |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
60 fdb Do18-Table |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
61 fdb Do19-Table |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
62 fdb Do1A-Table |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
63 fdb NoOp-Table |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
64 fdb Do1C-Table |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
65 fdb Do1D-Table |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
66 fdb NoOp-Table |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
67 fdb NoOp-Table |
26 | 68 |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
69 * Fix X/Y coords: |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
70 * - if Y > 191 then cap it at 191 |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
71 * - adjust X coord if in 128x192 mode |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
72 FixXY ldd <V.NChar,u get next 2 charas |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
73 cmpb #192 Y greater than max? |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
74 bcs L0053 branch if lower than |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
75 ldb #191 |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
76 L0053 tst <V.Mode,u which mode? |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
77 bmi L0059 branch if 256x192 |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
78 lsra else divide X by 2 |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
79 L0059 std <V.NChar,u and save |
21 | 80 rts |
26 | 81 |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
82 * $15 - set graphics cursor |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
83 Do15 leax <SetGC,pcr load X with return address |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
84 GChar2 ldb #$02 need two parameters |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
85 lbra GChar |
26 | 86 |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
87 SetGC bsr FixXY fix coords |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
88 std <V.GCrsX,u and save new gfx cursor pos |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
89 |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
90 NoOp |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
91 Init |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
92 Term clrb |
21 | 93 rts |
26 | 94 |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
95 * $19 - erase point |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
96 Do19 clr <V.Msk1,u |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
97 * $18 - set point |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
98 Do18 leax <DrawPnt,pcr |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
99 bra GChar2 |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
100 |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
101 DrawPnt bsr FixXY fix coords |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
102 std <V.GCrsX,u save as new gfx cursor pos |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
103 bsr DrwPt2 |
21 | 104 lbra L014A |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
105 DrwPt2 jsr [<V.CnvVct,u] |
21 | 106 L0081 tfr a,b |
107 comb | |
108 andb ,x | |
109 stb ,x | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
110 anda <V.Msk1,u and with mask |
21 | 111 ora ,x |
112 sta ,x | |
113 rts | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
114 |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
115 * $17 - erase line |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
116 Do17 clr <V.Msk1,u clear mask value |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
117 |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
118 * $16 - draw line |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
119 Do16 leax <DrawLine,pcr load X with return address |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
120 bra GChar2 need two params |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
121 |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
122 DrawLine bsr FixXY fix up coords |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
123 leas -$0E,s make room on stack |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
124 std $0C,s save X/Y |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
125 jsr [<V.CnvVct,u] get address given X/Y |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
126 stx $02,s save on stack |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
127 sta $01,s and pixel too |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
128 ldd <V.GCrsX,u get current graphics cursor |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
129 jsr [<V.CnvVct,u] get address given X/Y |
21 | 130 sta ,s |
131 clra | |
132 clrb | |
133 std $04,s | |
134 lda #$BF | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
135 suba <V.GCrsY,u |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
136 sta <V.GCrsY,u |
21 | 137 lda #$BF |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
138 suba <V.NChr2,u |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
139 sta <V.NChr2,u |
21 | 140 lda #$FF |
141 sta $06,s | |
142 clra | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
143 ldb <V.GCrsX,u |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
144 subb <V.NChar,u |
21 | 145 sbca #$00 |
146 bpl L00D6 | |
147 nega | |
148 negb | |
149 sbca #$00 | |
150 neg $06,s | |
151 L00D6 std $08,s | |
152 bne L00DF | |
153 ldd #$FFFF | |
154 std $04,s | |
155 L00DF lda #$E0 | |
156 sta $07,s | |
157 clra | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
158 ldb <V.GCrsY,u |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
159 subb <V.NChr2,u |
21 | 160 sbca #$00 |
161 bpl L00F4 | |
162 nega | |
163 negb | |
164 sbca #$00 | |
165 neg $07,s | |
166 L00F4 std $0A,s | |
167 bra L0100 | |
168 L00F8 sta ,s | |
169 ldd $04,s | |
170 subd $0A,s | |
171 std $04,s | |
172 L0100 lda ,s | |
173 lbsr L0081 | |
174 cmpx $02,s | |
175 bne L010F | |
176 lda ,s | |
177 cmpa $01,s | |
178 beq L0143 | |
179 L010F ldd $04,s | |
180 bpl L011D | |
181 addd $08,s | |
182 std $04,s | |
183 lda $07,s | |
184 leax a,x | |
185 bra L0100 | |
186 L011D lda ,s | |
187 ldb $06,s | |
188 bpl L0133 | |
189 lsla | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
190 ldb <V.Mode,u which mode? |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
191 bmi L012A branch if 256x192 |
21 | 192 lsla |
193 L012A bcc L00F8 | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
194 lda <V.4A,u |
21 | 195 leax -$01,x |
196 bra L00F8 | |
197 L0133 lsra | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
198 ldb <V.Mode,u which mode? |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
199 bmi L013A branch if 256x196 |
21 | 200 lsra |
201 L013A bcc L00F8 | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
202 lda <V.MCol,u |
21 | 203 leax $01,x |
204 bra L00F8 | |
205 L0143 ldd $0C,s | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
206 std <V.GCrsX,u |
21 | 207 leas $0E,s |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
208 L014A lda <V.Msk2,u |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
209 sta <V.Msk1,u |
21 | 210 clrb |
211 rts | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
212 |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
213 * $1C - erase circle |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
214 Do1C clr <V.Msk1,u clear mask value |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
215 * $1A - draw circle |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
216 Do1A leax <Circle,pcr |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
217 ldb #$01 require another param -- radius |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
218 GChar stb <V.NGChr,u one more char |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
219 stx <V.RTAdd,u return address |
21 | 220 clrb |
221 rts | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
222 |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
223 Circle leas -$04,s make room on stack |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
224 ldb <V.NChr2,u get radius |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
225 stb $01,s store on stack |
21 | 226 clra |
227 sta ,s | |
228 addb $01,s | |
229 adca #$00 | |
230 nega | |
231 negb | |
232 sbca #$00 | |
233 addd #$0003 | |
234 std $02,s | |
235 L0179 lda ,s | |
236 cmpa $01,s | |
237 bcc L01AB | |
238 ldb $01,s | |
239 bsr L01B9 | |
240 clra | |
241 ldb $02,s | |
242 bpl L0193 | |
243 ldb ,s | |
244 lslb | |
245 rola | |
246 lslb | |
247 rola | |
248 addd #$0006 | |
249 bra L01A3 | |
250 L0193 dec $01,s | |
251 clra | |
252 ldb ,s | |
253 subb $01,s | |
254 sbca #$00 | |
255 lslb | |
256 rola | |
257 lslb | |
258 rola | |
259 addd #$000A | |
260 L01A3 addd $02,s | |
261 std $02,s | |
262 inc ,s | |
263 bra L0179 | |
264 L01AB lda ,s | |
265 cmpa $01,s | |
266 bne L01B5 | |
267 ldb $01,s | |
268 bsr L01B9 | |
269 L01B5 leas $04,s | |
270 bra L014A | |
271 L01B9 leas -$08,s | |
272 sta ,s | |
273 clra | |
274 std $02,s | |
275 nega | |
276 negb | |
277 sbca #$00 | |
278 std $06,s | |
279 ldb ,s | |
280 clra | |
281 std ,s | |
282 nega | |
283 negb | |
284 sbca #$00 | |
285 std $04,s | |
286 ldx $06,s | |
287 bsr L0202 | |
288 ldd $04,s | |
289 ldx $02,s | |
290 bsr L0202 | |
291 ldd ,s | |
292 ldx $02,s | |
293 bsr L0202 | |
294 ldd ,s | |
295 ldx $06,s | |
296 bsr L0202 | |
297 ldd $02,s | |
298 ldx ,s | |
299 bsr L0202 | |
300 ldd $02,s | |
301 ldx $04,s | |
302 bsr L0202 | |
303 ldd $06,s | |
304 ldx $04,s | |
305 bsr L0202 | |
306 ldd $06,s | |
307 ldx ,s | |
308 bsr L0202 | |
309 leas $08,s | |
310 rts | |
311 L0202 pshs b,a | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
312 ldb <V.GCrsY,u |
21 | 313 clra |
314 leax d,x | |
315 cmpx #$0000 | |
316 bmi L0214 | |
317 cmpx #$00BF | |
318 ble L0216 | |
319 L0214 puls pc,b,a | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
320 L0216 ldb <V.GCrsX,u |
21 | 321 clra |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
322 tst <V.Mode,u |
21 | 323 bmi L0221 |
324 lslb | |
325 rola | |
326 L0221 addd ,s++ | |
327 tsta | |
328 beq L0227 | |
329 rts | |
330 L0227 pshs b | |
331 tfr x,d | |
332 puls a | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
333 tst <V.Mode,u which mode? |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
334 lbmi DrwPt2 branch if 256x192 |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
335 lsra else divide A by 2 |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
336 lbra DrwPt2 |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
337 |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
338 * $1D - flood fill |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
339 Do1D clr <V.FFFlag,u |
21 | 340 leas -$07,s |
341 lbsr L03AB | |
342 lbcs L0346 | |
343 lda #$FF | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
344 sta <V.4F,u |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
345 ldd <V.GCrsX,u |
21 | 346 lbsr L0351 |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
347 lda <V.4C,u |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
348 sta <V.4D,u |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
349 tst <V.Mode,u which mode? |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
350 bpl L0261 branch if 128x192 |
21 | 351 tsta |
352 beq L0267 | |
353 lda #$FF | |
354 bra L0267 | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
355 L0261 leax >Mode1Clr,pcr |
21 | 356 lda a,x |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
357 L0267 sta <V.4E,u |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
358 cmpa <V.Msk1,u |
21 | 359 lbeq L0346 |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
360 ldd <V.GCrsX,u |
21 | 361 L0274 suba #$01 |
362 bcs L027F | |
363 lbsr L0351 | |
364 bcs L027F | |
365 beq L0274 | |
366 L027F inca | |
367 std $01,s | |
368 L0282 lbsr L0384 | |
369 adda #$01 | |
370 bcs L0290 | |
371 lbsr L0351 | |
372 bcs L0290 | |
373 beq L0282 | |
374 L0290 deca | |
375 ldx $01,s | |
376 lbsr L03D3 | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
377 neg <V.4F,u |
21 | 378 lbsr L03D3 |
379 L029C lbsr L03F9 | |
380 lbcs L0346 | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
381 tst <V.4F,u |
21 | 382 bpl L02B3 |
383 subb #$01 | |
384 bcs L029C | |
385 std $03,s | |
386 tfr x,d | |
387 decb | |
388 bra L02BD | |
389 L02B3 incb | |
390 cmpb #$BF | |
391 bhi L029C | |
392 std $03,s | |
393 tfr x,d | |
394 incb | |
395 L02BD std $01,s | |
396 lbsr L0351 | |
397 bcs L029C | |
398 L02C4 bne L02D2 | |
399 suba #$01 | |
400 bcc L02CD | |
401 inca | |
402 bra L02D6 | |
403 L02CD lbsr L0351 | |
404 bcc L02C4 | |
405 L02D2 adda #$01 | |
406 bcs L029C | |
407 L02D6 cmpd $03,s | |
408 bhi L029C | |
409 bsr L0351 | |
410 bcs L029C | |
411 bne L02D2 | |
412 std $05,s | |
413 cmpd $01,s | |
414 bcc L02FB | |
415 ldd $01,s | |
416 decb | |
417 cmpd $05,s | |
418 beq L02FB | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
419 neg <V.4F,u |
21 | 420 ldx $05,s |
421 lbsr L03D3 | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
422 neg <V.4F,u |
21 | 423 L02FB ldd $05,s |
424 L02FD std $01,s | |
425 L02FF bsr L0351 | |
426 bcs L030B | |
427 bne L030B | |
428 bsr L0384 | |
429 adda #$01 | |
430 bcc L02FF | |
431 L030B deca | |
432 ldx $01,s | |
433 lbsr L03D3 | |
434 std $05,s | |
435 adda #$01 | |
436 bcs L0326 | |
437 L0317 cmpd $03,s | |
438 bcc L0326 | |
439 adda #$01 | |
440 bsr L0351 | |
441 bcs L0326 | |
442 bne L0317 | |
443 bra L02FD | |
444 L0326 inc $03,s | |
445 inc $03,s | |
446 ldd $03,s | |
447 cmpa #$02 | |
448 lbcs L029C | |
449 ldd $05,s | |
450 cmpd $03,s | |
451 lbcs L029C | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
452 neg <V.4F,u |
21 | 453 ldx $03,s |
454 lbsr L03D3 | |
455 lbra L029C | |
456 L0346 leas $07,s | |
457 clrb | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
458 ldb <V.FFFlag,u |
21 | 459 beq L0350 |
26 | 460 L034E orcc #Carry |
21 | 461 L0350 rts |
462 L0351 pshs b,a | |
463 cmpb #$BF | |
464 bhi L0380 | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
465 tst <V.Mode,u which mode? |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
466 bmi L0360 branch if 256x192 |
21 | 467 cmpa #$7F |
468 bhi L0380 | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
469 L0360 jsr [<V.CnvVct,u] |
21 | 470 tfr a,b |
471 andb ,x | |
472 L0367 bita #$01 | |
473 bne L0376 | |
474 lsra | |
475 lsrb | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
476 tst <V.Mode,u which mode? |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
477 bmi L0367 branch if 256x192 |
21 | 478 lsra |
479 lsrb | |
480 bra L0367 | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
481 L0376 stb <V.4C,u |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
482 cmpb <V.4D,u |
26 | 483 andcc #^Carry |
21 | 484 puls pc,b,a |
26 | 485 L0380 orcc #Carry |
21 | 486 puls pc,b,a |
487 L0384 pshs b,a | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
488 jsr [<V.CnvVct,u] |
21 | 489 bita #$80 |
490 beq L03A6 | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
491 ldb <V.4E,u |
21 | 492 cmpb ,x |
493 bne L03A6 | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
494 ldb <V.Msk1,u |
21 | 495 stb ,x |
496 puls b,a | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
497 tst <V.Mode,u which mode? |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
498 bmi L03A3 branch if 256x192 |
21 | 499 adda #$03 |
500 rts | |
501 L03A3 adda #$07 | |
502 rts | |
503 L03A6 lbsr L0081 | |
504 puls pc,b,a | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
505 L03AB ldx <V.FFSTp,u get top of flood fill stack |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
506 beq L03B5 if zero, we need to allocate stack |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
507 stx <V.FFSPt,u else reset flood fill stack ptr |
21 | 508 L03B3 clrb |
509 rts | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
510 |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
511 * Allocate Flood Fill Stack |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
512 L03B5 pshs u save U for now |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
513 ldd #$0200 get 512 bytes |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
514 os9 F$SRqMem from system |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
515 bcc AllocOk branch if ok |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
516 puls pc,u else pull out with error |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
517 AllocOk tfr u,d move pointer to alloced mem to D |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
518 puls u get stat pointer we saved earlier |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
519 std <V.FFMem,u save pointer to alloc'ed mem |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
520 addd #512 point D to end of alloc'ed mem |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
521 std <V.FFSTp,u and save here as top of fill stack |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
522 std <V.FFSPt,u and here |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
523 bra L03B3 do a clean return |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
524 |
21 | 525 L03D3 pshs b,a |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
526 ldd <V.FFSPt,u |
21 | 527 subd #$0004 |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
528 cmpd <V.FFMem,u |
21 | 529 bcs L03F2 |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
530 std <V.FFSPt,u |
21 | 531 tfr d,y |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
532 lda <V.4F,u |
21 | 533 sta ,y |
534 stx $01,y | |
535 puls b,a | |
536 sta $03,y | |
537 rts | |
538 L03F2 ldb #$F5 | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
539 stb <V.FFFlag,u |
21 | 540 puls pc,b,a |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
541 L03F9 ldd <V.FFSPt,u |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
542 cmpd <V.FFSTp,u top of flood fill stack? |
21 | 543 lbcc L034E |
544 tfr d,y | |
545 addd #$0004 | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
546 std <V.FFSPt,u |
21 | 547 lda ,y |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1325
diff
changeset
|
548 sta <V.4F,u |
21 | 549 ldd $01,y |
550 tfr d,x | |
551 lda $03,y | |
26 | 552 andcc #^Carry |
21 | 553 rts |
554 | |
555 emod | |
556 eom equ * | |
557 end | |
558 |