Mercurial > hg > Members > kono > nitros9-code
annotate level2/modules/vdgint.asm @ 754:c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
module as prior
author | boisy |
---|---|
date | Wed, 08 Jan 2003 17:33:48 +0000 |
parents | 02a8ba2b9092 |
children | f8ac18a97b69 |
rev | line source |
---|---|
508
02a8ba2b9092
Added headers to most source files, added clock2_bb.asm
boisy
parents:
0
diff
changeset
|
1 ******************************************************************** |
02a8ba2b9092
Added headers to most source files, added clock2_bb.asm
boisy
parents:
0
diff
changeset
|
2 * VDGInt - CoCo 3 VDG I/O module |
02a8ba2b9092
Added headers to most source files, added clock2_bb.asm
boisy
parents:
0
diff
changeset
|
3 * |
02a8ba2b9092
Added headers to most source files, added clock2_bb.asm
boisy
parents:
0
diff
changeset
|
4 * $Id$ |
02a8ba2b9092
Added headers to most source files, added clock2_bb.asm
boisy
parents:
0
diff
changeset
|
5 * |
02a8ba2b9092
Added headers to most source files, added clock2_bb.asm
boisy
parents:
0
diff
changeset
|
6 * Ed. Comments Who YY/MM/DD |
02a8ba2b9092
Added headers to most source files, added clock2_bb.asm
boisy
parents:
0
diff
changeset
|
7 * ------------------------------------------------------------------ |
02a8ba2b9092
Added headers to most source files, added clock2_bb.asm
boisy
parents:
0
diff
changeset
|
8 |
0 | 9 nam VDGInt |
10 ttl CoCo 3 VDG I/O module | |
11 | |
12 * Disassembled 98/09/31 12:15:57 by Disasm v1.6 (C) 1988 by RML | |
13 | |
14 ifp1 | |
15 use defsfile | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
16 use vdgdefs |
0 | 17 endc |
18 | |
19 tylg set Systm+Objct | |
20 atrv set ReEnt+rev | |
21 rev set $01 | |
22 edition set 3 | |
23 | |
24 mod eom,name,tylg,atrv,start,size | |
25 | |
26 u0000 rmb 0 | |
27 size equ . | |
28 | |
29 fcb $07 | |
30 | |
31 name fcs /VDGInt/ | |
32 fcb edition | |
33 | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
34 start lbra Read actually more like INIZ... |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
35 lbra Write |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
36 lbra GetStat |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
37 lbra SetStat |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
38 lbra Term |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
39 |
0 | 40 cmpa #$00 |
41 bne L0035 | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
42 ldb <VD.DGBuf,u get number of currently displayed bufs |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
43 lbne ShowS |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
44 ldd <VD.TFlg1,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
45 lbra DAlfa2 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
46 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
47 L0035 cmpa #$01 set x,y size of window? |
0 | 48 beq L003B |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
49 clrb no errors |
0 | 50 rts |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
51 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
52 L003B ldx <D.CCMem pointer to start of CC memory |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
53 leax <$54,x to X,Y coor, X,Y window |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
54 IFNE H6309 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
55 ldq ,x |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
56 stq $04,x get X,Y coordinate |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
57 ELSE |
0 | 58 ldd ,x |
59 std $04,x | |
60 ldd $02,x | |
61 std $06,x | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
62 ENDC |
0 | 63 clrb |
64 rts | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
65 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
66 * Terminate device |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
67 Term pshs u,y,x |
0 | 68 ldb #$03 |
69 L004E pshs b | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
70 lbsr GetScrn |
0 | 71 lbsr L065B |
72 puls b | |
73 decb | |
74 bne L004E | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
75 clr <VD.Start,u |
0 | 76 ldd #$0200 |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
77 ldu <VD.SCrnA,u return VDG text screen memory |
0 | 78 beq L0069 |
79 os9 F$SRtMem | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
80 L0069 ldb #$E1 size of 1 page -$1D (SCF memory requirements) |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
81 leax <VD.Strt1,u |
0 | 82 clra |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
83 L006F sta ,x+ set stored byte to zero |
0 | 84 decb |
85 bne L006F | |
86 bra L00D5 | |
87 | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
88 * Read bytes from IN |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
89 * Actually, this is more like an INIZ of the device. |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
90 Read pshs u,y,x |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
91 bsr L00D8 set up palettes |
0 | 92 lda #$AF |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
93 sta <VD.CColr,u default color cursor |
0 | 94 pshs u |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
95 ldd #768 gets 1 page on an odd page boundary |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
96 os9 F$SRqMem request from top of sys ram |
0 | 97 tfr u,d |
98 tfr u,x | |
99 bita #$01 | |
100 beq L0095 | |
101 leax >$0100,x | |
102 bra L0099 | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
103 L0095 leau >$0200,u we only need 2 pages for the screen memory |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
104 L0099 ldd #256 1 page return |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
105 os9 F$SRtMem return system memory |
0 | 106 puls u |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
107 stx <VD.ScrnA,u save start address of the screen |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
108 stx <VD.CrsrA,u and start cursor position |
0 | 109 leax >$0200,x |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
110 stx <VD.ScrnE,u point to the end of the screen |
0 | 111 lda #$60 |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
112 sta <VD.CChar,u character under the cursor |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
113 sta <VD.Chr1,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
114 lbsr ClrScn |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
115 inc <VD.Start,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
116 ldd <VD.Strt1,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
117 lbsr L054C set to true lowercase, screen size |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
118 leax <VD.NChar,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
119 stx <VD.EPlt1,u where to get next character from |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
120 stx <VD.EPlt2,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
121 ldu <D.CCMem |
0 | 122 ldb <$24,u |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
123 orb #$02 set to VDGINT found |
0 | 124 stb <$24,u |
125 L00D5 clrb | |
126 puls pc,u,y,x | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
127 |
0 | 128 L00D8 pshs u,y,x,b,a |
129 lda #$08 | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
130 sta <VD.PlFlg,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
131 leax >L011A,pcr default palette |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
132 leay <VD.Palet,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
133 L00E6 leau >L00F8,pcr CMP to RGB conversion |
0 | 134 L00EA pshs u |
135 leau >L012A,pcr | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
136 ldb #16 |
0 | 137 L00F2 lda ,x+ |
138 jmp [,s] | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
139 L00F6 lda a,u remap to CMP values |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
140 L00F8 sta ,y+ and save RGB data |
0 | 141 decb |
142 bne L00F2 | |
143 leas $02,s | |
144 L00FF puls pc,u,y,x,b,a | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
145 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
146 L0101 pshs u,y,x,b,a puts palette data in. |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
147 lda >WGlobal+G.CrDvFl is this screen active? |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
148 beq L00FF 0 = not active |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
149 leax <VD.Palet,u |
0 | 150 ldy #$FFB0 |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
151 lda >WGlobal+G.MonTyp universal RGB/CMP 0 = CMP, 1 = RGB, 2 = MONO |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
152 bne L00E6 if not 0 (CMP) don't re-map colors |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
153 leau >L00F6,pcr else do re-map colors |
0 | 154 bra L00EA |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
155 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
156 L011A fcb $12,$36,$09,$24 default palette data |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
157 fcb $3f,$1b,$2d,$26 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
158 fcb $00,$12,$00,$3f |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
159 fcb $00,$12,$00,$26 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
160 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
161 * converts CMP to RGB |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
162 L012A fdb $000c,$020e,$0709,$0510 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
163 fdb $1c2c,$0d1d,$0b1b,$0a2b |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
164 fdb $2211,$1221,$0301,$1332 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
165 fdb $1e2d,$1f2e,$0f3c,$2f3d |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
166 fdb $1708,$1506,$2716,$2636 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
167 fdb $192a,$1a3a,$1829,$2838 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
168 fdb $1404,$2333,$2535,$2434 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
169 fdb $203B,$313E,$3739,$3F30 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
170 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
171 * Entry: A = char to write |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
172 * Y = path desc ptr |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
173 Write cmpa #$0E |
0 | 174 bls L01CF |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
175 cmpa #$1B escape code? |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
176 lbeq Escpe yes, do escape immediately |
0 | 177 cmpa #$1F |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
178 lbls L01CD ignore gfx codes if not CoCo 2 compatible |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
179 |
0 | 180 tsta |
181 bmi L01BA | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
182 ldb <VD.CFlag,u |
0 | 183 beq L019A |
184 cmpa #$5E | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
185 bne L018A re-map characters from ASCII-VDG |
0 | 186 lda #$00 |
187 bra L01BA | |
188 L018A cmpa #$5F | |
189 bne L0192 | |
190 lda #$1F | |
191 bra L01BA | |
192 L0192 cmpa #$60 | |
193 bne L01AA | |
194 lda #$67 | |
195 bra L01BA | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
196 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
197 L019A cmpa #$7C true lowercase |
0 | 198 bne L01A2 |
199 lda #$21 | |
200 bra L01BA | |
201 L01A2 cmpa #$7E | |
202 bne L01AA | |
203 lda #$2D | |
204 bra L01BA | |
205 L01AA cmpa #$60 | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
206 bcs L01B2 re-map ASCII |
0 | 207 suba #$60 |
208 bra L01BA | |
209 L01B2 cmpa #$40 | |
210 bcs L01B8 | |
211 suba #$40 | |
212 L01B8 eora #$40 | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
213 L01BA ldx <VD.CrsrA,u |
0 | 214 sta ,x+ |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
215 stx <VD.CrsrA,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
216 cmpx <VD.ScrnE,u |
0 | 217 bcs L01CA |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
218 lbsr SScrl if at end of screen, scroll it |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
219 L01CA lbsr PCrsr ends with a CLRB/RTS anyhow |
0 | 220 L01CD clrb |
221 rts | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
222 |
0 | 223 L01CF leax >L01D8,pcr |
224 lsla | |
225 ldd a,x | |
226 jmp d,x | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
227 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
228 L01D8 fdb L01CD-L01D8 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
229 fdb CHome-L01D8 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
230 fdb CrsrXY-L01D8 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
231 fdb TELin-L01D8 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
232 fdb CELin-L01D8 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
233 fdb COnOf-L01D8 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
234 fdb CRght-L01D8 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
235 fdb L01CD-L01D8 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
236 fdb CLeft-L01D8 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
237 fdb L036A-L01D8 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
238 fdb CDown-L01D8 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
239 fdb TEScn-L01D8 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
240 fdb ClrScn-L01D8 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
241 fdb Retrn-L01D8 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
242 fdb DAlfa-L01D8 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
243 fdb $53c6 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
244 fdb $F539 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
245 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
246 * $1B does palette changes |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
247 Escpe ldx <VD.EPlt1,u now X points to VD.NChar |
0 | 248 lda ,x |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
249 cmpa #$30 default color |
0 | 250 bne L0209 |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
251 lbsr L00D8 do default palette |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
252 lbra L026E put palette and exit |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
253 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
254 L0209 cmpa #$31 change palette |
0 | 255 lbeq L0258 |
256 cmpa #$21 | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
257 lbne L01CD return without error |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
258 ldx PD.RGS,y |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
259 lda R$A,x |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
260 ldx <D.Proc |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
261 cmpa >P$SelP,x |
0 | 262 beq L0249 |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
263 ldb >P$SelP,x |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
264 sta >P$SelP,x |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
265 pshs y save our path desc ptr |
0 | 266 bsr L024A |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
267 ldy V$STAT,y |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
268 ldx <D.CCMem |
0 | 269 cmpy <$20,x |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
270 puls y restore our path desc ptr |
0 | 271 bne L0248 |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
272 inc <VD.DFlag,u |
0 | 273 ldy <$20,x |
274 sty <$22,x | |
275 stu <$20,x | |
276 L0248 clrb | |
277 L0249 rts | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
278 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
279 L024A leax <P$Path,x |
0 | 280 lda b,x |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
281 ldx <D.PthDBT |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
282 os9 F$Find64 put found path descriptor in Y |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
283 ldy PD.DEV,y load Y with device table entry |
0 | 284 rts |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
285 |
0 | 286 L0258 leax <L0260,pcr |
287 ldb #$02 | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
288 lbra GChar |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
289 L0260 ldx <VD.EPlt1,u |
0 | 290 ldd ,x |
291 anda #$0F | |
292 andb #$3F | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
293 leax <VD.Palet,u |
0 | 294 stb a,x |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
295 L026E inc <VD.DFlag,u |
0 | 296 clrb |
297 rts | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
298 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
299 * Screen scroll |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
300 SScrl ldx <VD.SCrnA,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
301 leax <32,x |
0 | 302 L0279 ldd ,x++ |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
303 std <-34,x |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
304 cmpx <VD.ScrnE,u |
0 | 305 bcs L0279 |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
306 leax <-32,x |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
307 stx <VD.CrsrA,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
308 lda #32 |
0 | 309 ldb #$60 |
310 L028D stb ,x+ | |
311 deca | |
312 bne L028D | |
313 rts | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
314 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
315 * $0D carriage return |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
316 Retrn bsr KCrsr |
0 | 317 tfr x,d |
318 andb #$E0 | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
319 stb <VD.CrsAL,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
320 PCrsr ldx <VD.CrsrA,u |
0 | 321 lda ,x |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
322 sta <VD.CChar,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
323 lda <VD.CColr,u |
0 | 324 beq L02AB |
325 L02A9 sta ,x | |
326 L02AB clrb | |
327 rts | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
328 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
329 * $0A moves cursor down |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
330 CDown bsr KCrsr |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
331 leax <32,x go down one line |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
332 cmpx <VD.SCrnE,u at the end of the screen? |
0 | 333 bcs L02C1 |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
334 leax <-32,x if so, go back up one line |
0 | 335 pshs x |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
336 lbsr SScrl and scroll the screen |
0 | 337 puls x |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
338 L02C1 stx <VD.CRsrA,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
339 bra PCrsr |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
340 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
341 * $08 moves cursor left one |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
342 CLeft bsr KCrsr |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
343 cmpx <VD.SCrnA,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
344 bls L02D2 ignore it if at the screen start |
0 | 345 leax -$01,x |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
346 stx <VD.CRsrA,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
347 L02D2 bra PCrsr |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
348 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
349 * $06 moves cursor right one |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
350 CRght bsr KCrsr |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
351 leax $01,x to right one |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
352 cmpx <VD.SCrnE,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
353 bcc L02E0 if past end, ignore it |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
354 stx <VD.CRsrA,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
355 L02E0 bra PCrsr |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
356 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
357 * $0B erase from current char to end of screen |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
358 TEScn bsr KCrsr kill the cursor |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
359 bra L02E8 and clear the rest of the screen |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
360 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
361 * $0C clear screen & home cursor |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
362 ClrScn bsr CHome home cursor |
0 | 363 L02E8 lda #$60 |
364 L02EA sta ,x+ | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
365 cmpx <VD.SCrnE,u |
0 | 366 bcs L02EA |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
367 bra PCrsr |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
368 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
369 * $01 Homes the cursor |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
370 CHome bsr KCrsr |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
371 ldx <VD.SCrnA,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
372 stx <VD.CRsrA,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
373 bra PCrsr |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
374 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
375 * Kill the cursor from the screen |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
376 KCrsr ldx <VD.CRsrA,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
377 lda <VD.CChar,u |
0 | 378 sta ,x |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
379 clrb must be here, in general, for [...] BRA KCrsr |
0 | 380 rts |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
381 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
382 * $05 turns cursor on/off, color |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
383 COnOf lda <VD.NChar,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
384 suba #C$SPAC take out ASCII space |
0 | 385 bne L0313 |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
386 sta <VD.CColr,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
387 bra KCrsr |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
388 L0313 cmpa #$0B sets up cursor color |
0 | 389 bge L02AB |
390 cmpa #$01 | |
391 bgt L031F | |
392 lda #$AF | |
393 bra L032F | |
394 L031F cmpa #$02 | |
395 bgt L0327 | |
396 lda #$A0 | |
397 bra L032F | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
398 ** BUG ** BUG ** BUG ** BUG |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
399 L0327 subb #$03 ** BUG ** !!! Should be SUBA |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
400 lsla left in for backwards compatibility |
0 | 401 lsla |
402 lsla | |
403 lsla | |
404 ora #$8F | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
405 L032F sta <VD.CColr,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
406 ldx <VD.CrsrA,u |
0 | 407 lbra L02A9 |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
408 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
409 * $02 moves cursor to X,Y |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
410 CrsrXY ldb #$02 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
411 leax <L0340,pcr goto there after |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
412 lbra GChar get two chars |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
413 L0340 bsr KCrsr |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
414 ldb <VD.NChr2,u get ASCII Y-pos |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
415 subb #C$SPAC take out ASCII space |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
416 lda #32 go down |
0 | 417 mul |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
418 addb <VD.NChar,u add in X-pos |
0 | 419 adca #$00 |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
420 subd #C$SPAC take out another ASCII space |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
421 addd <VD.ScrnA,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
422 cmpd <VD.ScrnE,u at end of the screen? |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
423 lbcc L02AB exit if off the screen |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
424 std <VD.CRsrA,u otherwise save new cursor address |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
425 lbra PCrsr |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
426 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
427 * $04 clear characters to end of line |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
428 CELin bsr KCrsr |
0 | 429 tfr x,d |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
430 andb #$1F number of characters put on this line |
0 | 431 pshs b |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
432 ldb #32 |
0 | 433 subb ,s+ |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
434 bra L0376 and clear one line |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
435 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
436 * $03 erase line cursor is on |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
437 TELin lbsr Retrn do a carriage return |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
438 ldb #32 B = $00 from Retrn |
0 | 439 L0376 lda #$60 |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
440 ldx <VD.CRsrA,u |
0 | 441 L037B sta ,x+ |
442 decb | |
443 bne L037B | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
444 lbra PCrsr |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
445 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
446 * $09 moves cursor up one line |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
447 L036A lbsr KCrsr |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
448 leax <-32,x |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
449 cmpx <VD.SCrnA,u |
0 | 450 bcs L0391 |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
451 stx <VD.CRsrA,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
452 L0391 lbra PCrsr |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
453 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
454 * $0E switches from graphics to alpha mode |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
455 DAlfa clra |
0 | 456 clrb |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
457 DAlfa2 pshs x,a |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
458 stb <VD.Alpha,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
459 clr <VD.DGBuf,u |
0 | 460 lda >PIA1Base+2 |
461 anda #$07 | |
462 ora ,s+ | |
463 tstb | |
464 bne L03AD | |
465 anda #$EF | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
466 ora <VD.CFlag,u lowercase flag |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
467 L03AD sta <VD.TFlg1,u save VDG info |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
468 tst >WGlobal+G.CrDvFl is this screen currently showing? |
0 | 469 lbeq L0440 |
470 sta >PIA1Base+2 | |
471 tstb | |
472 bne L03CB | |
473 stb >$FFC0 | |
474 stb >$FFC2 | |
475 stb >$FFC4 | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
476 lda <VD.ScrnA,u |
0 | 477 bra L03D7 |
478 L03CB stb >$FFC0 | |
479 stb >$FFC3 | |
480 stb >$FFC5 | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
481 lda <VD.SBAdd,u |
0 | 482 L03D7 lbsr L0101 |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
483 ldb <D.HINIT |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
484 orb #$80 set CoCo 2 compatible mode |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
485 stb <D.HINIT |
0 | 486 stb >$FF90 |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
487 ldb <D.VIDMD |
0 | 488 andb #$78 |
489 stb >$FF98 | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
490 stb <D.VIDMD |
0 | 491 clrb |
492 stb >$FF99 | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
493 stb <D.VIDRS |
0 | 494 stb >BordReg |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
495 stb <D.BORDR |
0 | 496 tfr a,b |
497 andb #$1F | |
498 pshs b | |
499 anda #$E0 | |
500 lsra | |
501 lsra | |
502 lsra | |
503 lsra | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
504 ldx <D.SysDAT |
0 | 505 leax a,x |
506 ldb $01,x | |
507 pshs b | |
508 andb #$38 | |
509 lslb | |
510 lslb | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
511 stb <D.VOFF1 |
0 | 512 stb >$FF9D |
513 clrb | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
514 stb <D.VOFF0 |
0 | 515 stb >$FF9E |
516 ldb #$0F | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
517 stb <D.VOFF2 |
0 | 518 stb >$FF9C |
519 puls a | |
520 lsla | |
521 lsla | |
522 lsla | |
523 lsla | |
524 lsla | |
525 ora ,s+ | |
526 ldb #$07 | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
527 ldx #$FFC6 Ok, now set up via old coco2 mode |
0 | 528 lsra |
529 L0430 lsra | |
530 bcs L0439 | |
531 sta ,x+ | |
532 leax $01,x | |
533 bra L043D | |
534 L0439 leax $01,x | |
535 sta ,x+ | |
536 L043D decb | |
537 bne L0430 | |
538 L0440 clrb | |
539 puls pc,x | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
540 |
0 | 541 pshs x,b,a |
542 clra | |
543 ldb $02,s | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
544 ldx <D.SysMem |
0 | 545 leax d,x |
546 puls b,a | |
547 L044E sta ,x+ | |
548 decb | |
549 bne L044E | |
550 puls pc,x | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
551 |
0 | 552 ldb #$01 |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
553 GChar stb <VD.NGChr,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
554 stx <VD.RTAdd,u |
0 | 555 clrb |
556 rts | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
557 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
558 GetStat ldx PD.RGS,y |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
559 cmpa #SS.AlfaS |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
560 beq RT.AlfaS |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
561 cmpa #SS.ScSiz |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
562 beq Rt.ScSiz |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
563 cmpa #SS.Cursr |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
564 beq Rt.Cursr |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
565 cmpa #SS.Palet |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
566 lbeq Rt.Palet |
0 | 567 comb |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
568 ldb #E$UnkSvc |
0 | 569 rts |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
570 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
571 * Returns window or screen size |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
572 Rt.ScSiz clra |
0 | 573 ldb <$42,u |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
574 std R$X,x |
0 | 575 ldb <$43,u |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
576 std R$Y,x |
0 | 577 clrb |
578 rts | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
579 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
580 * Get palette information |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
581 Rt.Palet pshs u,y,x |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
582 leay <VD.Palet,u point to palette data in proc desc |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
583 ldu R$X,x pointer to 16 byte palette buffer |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
584 ldx <D.Proc current proc desc |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
585 ldb P$Task,x destination task number |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
586 clra from task 0 |
0 | 587 tfr y,x |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
588 ldy #16 move 16 bytes |
0 | 589 os9 F$Move |
590 puls pc,u,y,x | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
591 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
592 * Return VDG alpha screen memory info |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
593 RT.AlfaS ldd <VD.ScrnA,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
594 anda #$E0 keep bits 4-6 |
0 | 595 lsra |
596 lsra | |
597 lsra | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
598 lsra move to bits 0-2 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
599 ldy <D.SysDAT |
0 | 600 ldd a,y |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
601 lbsr L06E1 map it in the process' memory area |
0 | 602 bcs L0521 |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
603 pshs b,a offset to block address |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
604 ldd <VD.ScrnA,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
605 anda #$1F make sure it's within the block |
0 | 606 addd ,s |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
607 std R$X,x memory address of the buffer |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
608 ldd <VD.CrsrA,u |
0 | 609 anda #$1F |
610 addd ,s++ | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
611 std R$Y,x memory address of the cursor |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
612 lda <VD.Caps,u save caps lock status in A and exit |
0 | 613 bra L051E |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
614 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
615 * Returns VDG alpha screen cursor info |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
616 Rt.Cursr ldd <VD.CrsrA,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
617 subd <VD.ScrnA,u |
0 | 618 pshs b,a |
619 clra | |
620 andb #$1F | |
621 addb #$20 | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
622 std R$X,x save column position in ASCII |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
623 puls b,a then divide by 32 |
0 | 624 lsra |
625 rolb | |
626 rolb | |
627 rolb | |
628 rolb | |
629 clra | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
630 andb #$0F only 16 lines to a screen |
0 | 631 addb #$20 |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
632 std R$Y,x |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
633 ldb <VD.CFlag,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
634 lda <VD.CChar,u |
0 | 635 bmi L051E |
636 cmpa #$60 | |
637 bcc L0509 | |
638 cmpa #$20 | |
639 bcc L050D | |
640 tstb | |
641 beq L0507 | |
642 cmpa #$00 | |
643 bne L04FF | |
644 lda #$5E | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
645 bra L051E save it and exit |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
646 |
0 | 647 L04FF cmpa #$1F |
648 bne L0507 | |
649 lda #$5F | |
650 bra L051E | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
651 L0507 ora #$20 turn it into ASCII from VDG codes |
0 | 652 L0509 eora #$40 |
653 bra L051E | |
654 L050D tstb | |
655 bne L051E | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
656 cmpa #$21 remap specific codes |
0 | 657 bne L0518 |
658 lda #$7C | |
659 bra L051E | |
660 L0518 cmpa #$2D | |
661 bne L051E | |
662 lda #$7E | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
663 L051E sta R$A,x |
0 | 664 clrb |
665 L0521 rts | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
666 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
667 SetStat ldx PD.RGS,y |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
668 cmpa #SS.ComSt |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
669 beq Rt.ComSt |
0 | 670 cmpa #$8F |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
671 lbeq RT.XScrn |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
672 cmpa #SS.DScrn |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
673 lbeq Rt.DScrn |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
674 cmpa #SS.PScrn |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
675 lbeq Rt.PScrn |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
676 cmpa #SS.AScrn |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
677 lbeq RT.AScrn |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
678 cmpa #SS.FScrn |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
679 lbeq Rt.FScrn |
0 | 680 comb |
681 ldb #$D0 | |
682 rts | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
683 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
684 * Allow switch between true/fake lowercase |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
685 Rt.ComSt ldd R$Y,x |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
686 L054C ldb #$10 sets screen to lowercase |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
687 bita #$01 Y = 0 = true lowercase, Y = 1 = fake lower |
0 | 688 bne L0553 |
689 clrb | |
690 L0553 stb <$35,u | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
691 ldd #$2010 32x16 |
0 | 692 inc <$23,u |
693 std <$42,u | |
694 rts | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
695 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
696 DTabl fcb $14 0: 640x192, 2 color |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
697 fcb $02 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
698 fcb $15 1: 320x192, 4 color |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
699 fcb $02 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
700 fcb $16 2: 160x192, 16 color |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
701 fcb $02 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
702 fcb $1D 3: 640x192, 4 color |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
703 fcb $04 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
704 fcb $1E 4: 320x192, 16 color |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
705 fcb $04 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
706 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
707 * Allocates and maps a hires screen into process address |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
708 RT.AScrn ldb R$X+1,x |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
709 cmpb #$04 screen type |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
710 bhi IllArg |
0 | 711 lda #$03 |
712 pshs y,x,b,a | |
713 lda #$03 | |
714 ldb #$03 | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
715 leay <VD.HiRes,u pointer to screen descriptor |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
716 lbsr L06C7 gets next free S.D. |
0 | 717 bcs L05AF |
718 sta ,s | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
719 ldb $01,s screen type |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
720 stb $02,y VD.SType |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
721 leax >DTabl,pcr |
0 | 722 lslb |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
723 leax b,x point to display code, #blocks |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
724 ldb $01,x get number of blocks |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
725 stb $01,y VD.NBlk |
0 | 726 lbsr L06DD |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
727 bcs L05AF deallocate ALL alloced blocks on error |
0 | 728 stb ,y |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
729 lda $01,x number of blocks |
0 | 730 ldy $02,s |
731 tst $04,y | |
732 bne L05A6 | |
733 lbsr L06E3 | |
734 bcs L05AF | |
735 L05A6 ldx $02,s | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
736 std R$X,x |
0 | 737 ldb ,s |
738 clra | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
739 std R$Y,x |
0 | 740 L05AF leas $02,s |
741 puls pc,y,x | |
742 L05B3 leas $02,s | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
743 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
744 IllArg comb |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
745 ldb #E$IllArg |
0 | 746 rts |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
747 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
748 RT.XScrn pshs x |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
749 ldb R$Y,x |
0 | 750 bmi L05C8 |
751 bsr L05DE | |
752 bcs L05DC | |
753 lbsr L06FF | |
754 bcs L05DC | |
755 L05C8 ldx ,s | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
756 ldb R$Y+1,x |
0 | 757 bmi L05DB |
758 bsr L05DE | |
759 bcs L05DC | |
760 lbsr L06E3 | |
761 bcs L05DC | |
762 ldx ,s | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
763 std R$X,x |
0 | 764 L05DB clrb |
765 L05DC puls pc,x | |
766 L05DE beq L05F1 | |
767 cmpb #$03 | |
768 bhi L05F1 | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
769 bsr GetScrn |
0 | 770 beq L05F1 |
771 ldb ,x | |
772 beq L05F1 | |
773 lda $01,x | |
774 andcc #^Carry | |
775 rts | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
776 L05F1 bra IllArg |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
777 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
778 * Convert screen to a different type |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
779 Rt.PScrn ldd R$X,x |
0 | 780 pshs b,a |
781 cmpd #$0004 | |
782 bhi L05B3 | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
783 leax >DTabl,pcr |
0 | 784 lslb |
785 incb | |
786 lda b,x | |
787 sta ,s | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
788 ldx R$Y,y |
0 | 789 bsr L061B |
790 bcs L05B3 | |
791 lda ,s | |
792 cmpa $01,x | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
793 bhi L05B3 if new one takes more blocks than old |
0 | 794 lda $01,s |
795 sta $02,x | |
796 leas $02,s | |
797 bra L0633 | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
798 L061B ldd R$Y,x |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
799 bmi IllArg |
0 | 800 beq L0633 |
801 cmpd #$0003 | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
802 bgt IllArg |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
803 bsr GetScrn point X to 3 byte screen descriptor |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
804 lda ,x start block #, # of blocks, screen type |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
805 beq IllArg |
0 | 806 clra |
807 rts | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
808 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
809 * Displays screen |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
810 Rt.DScrn bsr L061B |
0 | 811 bcs L063A |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
812 L0633 stb <VD.DGBuf,u |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
813 inc <VD.DFlag,u |
0 | 814 clrb |
815 L063A rts | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
816 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
817 * Entry: D = screen 1-3 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
818 * Exit: X = ptr to screen buffer |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
819 GetScrn pshs b,a |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
820 leax <VD.GBuff,u |
0 | 821 lda #$03 |
822 mul | |
823 leax b,x | |
824 puls pc,b,a | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
825 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
826 * Frees memory of screen allocated by SS.AScrn |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
827 Rt.FScrn tst R$Y,x |
0 | 828 bne L05F1 |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
829 ldb R$Y+1,x |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
830 cmpb <VD.DGBuf,u |
0 | 831 beq L05F1 |
832 tstb | |
833 lbsr L05DE | |
834 bcs L05F1 | |
835 lbsr L06FF | |
836 L065B lda $01,x | |
837 ldb ,x | |
838 beq L066D | |
839 pshs a | |
840 clra | |
841 sta ,x | |
842 tfr d,x | |
843 puls b | |
844 os9 F$DelRAM | |
845 L066D rts | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
846 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
847 ShowS cmpb #$03 no more than 3 graphics buffers |
0 | 848 bhi L06C6 |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
849 bsr GetScrn point X to appropriate screen descriptor |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
850 ldb ,x VD.HiRes - start block of screen |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
851 beq L06C6 if not allocated |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
852 ldb $02,x VD.SType - screen type 0-4 |
0 | 853 cmpb #$04 |
854 bhi L06C6 | |
855 lslb | |
856 pshs x | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
857 leax >DTabl,pcr |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
858 ldb b,x get proper display code |
0 | 859 puls x |
860 stb >$FF99 | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
861 stb >D.VIDRS |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
862 lda >D.HINIT |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
863 anda #$7F make coco 3 only mode |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
864 sta >D.HINIT |
0 | 865 sta >$FF90 |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
866 lda >D.VIDMD |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
867 ora #$80 graphics mode |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
868 anda #$F8 1 line/character row |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
869 sta >D.VIDMD |
0 | 870 sta >$FF98 |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
871 clr >D.BORDR |
0 | 872 clr >BordReg |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
873 lda ,x get block # |
0 | 874 lsla |
875 lsla | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
876 sta >D.VOFF1 |
0 | 877 sta >$FF9D |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
878 clr >D.VOFF0 |
0 | 879 clr >$FF9E |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
880 clr >D.VOFF2 |
0 | 881 clr >$FF9C |
882 lbsr L0101 | |
883 L06C6 rts | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
884 |
0 | 885 L06C7 clr ,-s |
886 inc ,s | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
887 L06CB tst ,y check block # |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
888 beq L06D9 if not used yet |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
889 leay b,y go to next screen descriptor |
0 | 890 inc ,s |
891 deca | |
892 bne L06CB | |
893 comb | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
894 ldb #E$BMode |
0 | 895 L06D9 puls pc,a |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
896 |
0 | 897 ldb #$01 |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
898 L06DD os9 F$AlHRAM allocate a screen |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
899 rts |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
900 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
901 L06E1 lda #$01 map screen into memory |
0 | 902 L06E3 pshs u,x,b,a |
903 bsr L0710 | |
904 bcc L06F9 | |
905 clra | |
906 ldb $01,s | |
907 tfr d,x | |
908 ldb ,s | |
909 os9 F$MapBlk | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
910 stb $01,s save error code if any |
0 | 911 tfr u,d |
912 bcs L06FD | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
913 L06F9 leas $02,s destroy D on no error |
0 | 914 puls pc,u,x |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
915 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
916 L06FD puls pc,u,x,b,a if error, then restore D |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
917 |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
918 L06FF pshs y,x,a deallocate screen |
0 | 919 bsr L0710 |
920 bcs L070E | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
921 ldd #DAT.Free set memory to unused |
0 | 922 L0708 std ,x++ |
923 dec ,s | |
924 bne L0708 | |
925 L070E puls pc,y,x,a | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
926 |
0 | 927 L0710 pshs b,a |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
928 lda #$08 number of blocks to check |
0 | 929 sta $01,s |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
930 ldx <D.Proc |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
931 leax <P$DATImg+$10,x to end of CoCo's DAT image map |
0 | 932 clra |
933 addb ,s | |
934 decb | |
935 L071F cmpd ,--x | |
936 beq L072A | |
937 dec $01,s | |
938 bne L071F | |
939 bra L0743 | |
940 L072A dec $01,s | |
941 dec ,s | |
942 beq L0738 | |
943 decb | |
944 cmpd ,--x | |
945 beq L072A | |
946 bra L0743 | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
947 L0738 lda $01,s get lowest block number found |
0 | 948 lsla |
949 lsla | |
950 lsla | |
951 lsla | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
952 lsla multiply by 32 (convert to address) |
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
953 clrb clear carry |
0 | 954 leas $02,s |
955 rts | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
956 |
0 | 957 L0743 puls b,a |
958 comb | |
754
c81bad35f02f
Worked on commenting source and using proper symbolics, assembles to same
boisy
parents:
508
diff
changeset
|
959 ldb #E$BPAddr bad page address |
0 | 960 rts |
961 | |
962 emod | |
963 eom equ * | |
964 end |