annotate level1/modules/covdg.asm @ 3059:412772d32331

level1/ioman: Fix code to use R$ macro defines
author Robert Gault <robert.gault@att.net>
date Thu, 29 Jan 2015 22:50:26 +0100
parents b8c7b7fbf3c9
children 64ad5cd0b912 8f5a6fe2d09e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
1 ********************************************************************
1e312b144f4d Major changes:
boisy
parents:
diff changeset
2 * CoVDG - VDG Console Output Subroutine for VTIO
1e312b144f4d Major changes:
boisy
parents:
diff changeset
3 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
4 * $Id$
1e312b144f4d Major changes:
boisy
parents:
diff changeset
5 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
6 * Edt/Rev YYYY/MM/DD Modified by
1e312b144f4d Major changes:
boisy
parents:
diff changeset
7 * Comment
1e312b144f4d Major changes:
boisy
parents:
diff changeset
8 * ------------------------------------------------------------------
1e312b144f4d Major changes:
boisy
parents:
diff changeset
9 * 1 ????/??/??
1e312b144f4d Major changes:
boisy
parents:
diff changeset
10 * From Tandy OS-9 Level One VR 02.00.00
1e312b144f4d Major changes:
boisy
parents:
diff changeset
11 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
12 * 2003/09/22 Rodney Hamilton
1e312b144f4d Major changes:
boisy
parents:
diff changeset
13 * recoded dispatch table fcbs, fixed cursor color bug
1e312b144f4d Major changes:
boisy
parents:
diff changeset
14
1e312b144f4d Major changes:
boisy
parents:
diff changeset
15 nam CoVDG
1e312b144f4d Major changes:
boisy
parents:
diff changeset
16 ttl VDG Console Output Subroutine for VTIO
1e312b144f4d Major changes:
boisy
parents:
diff changeset
17
1e312b144f4d Major changes:
boisy
parents:
diff changeset
18 * Disassembled 98/08/23 17:47:40 by Disasm v1.6 (C) 1988 by RML
1e312b144f4d Major changes:
boisy
parents:
diff changeset
19
1e312b144f4d Major changes:
boisy
parents:
diff changeset
20 ifp1
1e312b144f4d Major changes:
boisy
parents:
diff changeset
21 use defsfile
2624
b8c7b7fbf3c9 Major changes:
Boisy Pitre <boisy.pitre@nuance.com>
parents: 1933
diff changeset
22 use cocovtio.d
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
23 endc
1e312b144f4d Major changes:
boisy
parents:
diff changeset
24
1e312b144f4d Major changes:
boisy
parents:
diff changeset
25 tylg set Systm+Objct
1e312b144f4d Major changes:
boisy
parents:
diff changeset
26 atrv set ReEnt+rev
1e312b144f4d Major changes:
boisy
parents:
diff changeset
27 rev set $00
1e312b144f4d Major changes:
boisy
parents:
diff changeset
28 edition set 1
1e312b144f4d Major changes:
boisy
parents:
diff changeset
29
1e312b144f4d Major changes:
boisy
parents:
diff changeset
30 mod eom,name,tylg,atrv,start,size
1e312b144f4d Major changes:
boisy
parents:
diff changeset
31
1e312b144f4d Major changes:
boisy
parents:
diff changeset
32 u0000 rmb 0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
33 size equ .
1e312b144f4d Major changes:
boisy
parents:
diff changeset
34 fcb $07
1e312b144f4d Major changes:
boisy
parents:
diff changeset
35
1e312b144f4d Major changes:
boisy
parents:
diff changeset
36 name fcs /CoVDG/
1e312b144f4d Major changes:
boisy
parents:
diff changeset
37 fcb edition
1e312b144f4d Major changes:
boisy
parents:
diff changeset
38
1e312b144f4d Major changes:
boisy
parents:
diff changeset
39 start equ *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
40 lbra Init
1e312b144f4d Major changes:
boisy
parents:
diff changeset
41 lbra Write
1e312b144f4d Major changes:
boisy
parents:
diff changeset
42 lbra GetStat
1e312b144f4d Major changes:
boisy
parents:
diff changeset
43 lbra SetStat
1e312b144f4d Major changes:
boisy
parents:
diff changeset
44 Term pshs y,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
45 pshs u save U
1e312b144f4d Major changes:
boisy
parents:
diff changeset
46 ldd #512 32x16 VDG memory size
1e312b144f4d Major changes:
boisy
parents:
diff changeset
47 ldu <V.ScrnA,u get pointer to memory
1e312b144f4d Major changes:
boisy
parents:
diff changeset
48 os9 F$SRtMem return to system
1e312b144f4d Major changes:
boisy
parents:
diff changeset
49 puls u restore U
1e312b144f4d Major changes:
boisy
parents:
diff changeset
50 ldb <V.COLoad,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
51 andb #~ModCoVDG
1e312b144f4d Major changes:
boisy
parents:
diff changeset
52 bra L0086
1e312b144f4d Major changes:
boisy
parents:
diff changeset
53 * Init
1e312b144f4d Major changes:
boisy
parents:
diff changeset
54 Init pshs y,x save regs
1e312b144f4d Major changes:
boisy
parents:
diff changeset
55 lda #$AF
1e312b144f4d Major changes:
boisy
parents:
diff changeset
56 sta <V.CColr,u save default color cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
57 pshs u save static ptr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
58 ldd #768 allocate 768 bytes for now
1e312b144f4d Major changes:
boisy
parents:
diff changeset
59 os9 F$SRqMem get it
1e312b144f4d Major changes:
boisy
parents:
diff changeset
60 tfr u,d put ptr in D
1e312b144f4d Major changes:
boisy
parents:
diff changeset
61 tfr u,x and X
1e312b144f4d Major changes:
boisy
parents:
diff changeset
62 bita #$01 odd page?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
63 beq L0052 branch if not
1e312b144f4d Major changes:
boisy
parents:
diff changeset
64 leax >256,x else move X up 256 bytes
1e312b144f4d Major changes:
boisy
parents:
diff changeset
65 bra L0056 and return first 256 bytes
1e312b144f4d Major changes:
boisy
parents:
diff changeset
66 L0052 leau >512,u else move X up 512 bytes
1e312b144f4d Major changes:
boisy
parents:
diff changeset
67 L0056 ldd #256 and return last 256 bytes
1e312b144f4d Major changes:
boisy
parents:
diff changeset
68 os9 F$SRtMem free it!
1e312b144f4d Major changes:
boisy
parents:
diff changeset
69 puls u restore static ptr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
70 stx <V.ScrnA,u save VDG screen memory
1e312b144f4d Major changes:
boisy
parents:
diff changeset
71 pshs y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
72 leay -$0E,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
73 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
74 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
75 jsr [<V.DspVct,u] display screen (routine in VTIO)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
76 puls y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
77 stx <V.CrsrA,u save start cursor position
1e312b144f4d Major changes:
boisy
parents:
diff changeset
78 leax >512,x point to end of screen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
79 stx <V.ScrnE,u save it
1e312b144f4d Major changes:
boisy
parents:
diff changeset
80 lda #$60 get default character
1e312b144f4d Major changes:
boisy
parents:
diff changeset
81 sta <V.CChar,u put character under the cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
82 sta <V.Chr1,u only referenced here ??
1e312b144f4d Major changes:
boisy
parents:
diff changeset
83 lbsr ClrScrn clear the screen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
84 ldb <V.COLoad,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
85 orb #ModCoVDG set to CoVDG found (?)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
86 L0086 stb <V.COLoad,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
87 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
88 puls pc,y,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
89
1e312b144f4d Major changes:
boisy
parents:
diff changeset
90 * Write
1e312b144f4d Major changes:
boisy
parents:
diff changeset
91 * Entry: A = char to write
1e312b144f4d Major changes:
boisy
parents:
diff changeset
92 * Y = path desc ptr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
93 Write tsta
1e312b144f4d Major changes:
boisy
parents:
diff changeset
94 bmi L00D0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
95 cmpa #$1F byte $1F?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
96 bls Dispatch branch if lower or same
1e312b144f4d Major changes:
boisy
parents:
diff changeset
97 ldb <V.CFlag,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
98 beq L00B0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
99 cmpa #$5E
1e312b144f4d Major changes:
boisy
parents:
diff changeset
100 bne L00A0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
101 lda #$00
1e312b144f4d Major changes:
boisy
parents:
diff changeset
102 bra L00D0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
103 L00A0 cmpa #$5F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
104 bne L00A8
1e312b144f4d Major changes:
boisy
parents:
diff changeset
105 lda #$1F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
106 bra L00D0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
107 L00A8 cmpa #$60
1e312b144f4d Major changes:
boisy
parents:
diff changeset
108 bne L00C0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
109 lda #$67
1e312b144f4d Major changes:
boisy
parents:
diff changeset
110 bra L00D0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
111 L00B0 cmpa #$7C
1e312b144f4d Major changes:
boisy
parents:
diff changeset
112 bne L00B8
1e312b144f4d Major changes:
boisy
parents:
diff changeset
113 lda #$21
1e312b144f4d Major changes:
boisy
parents:
diff changeset
114 bra L00D0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
115 L00B8 cmpa #$7E
1e312b144f4d Major changes:
boisy
parents:
diff changeset
116 bne L00C0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
117 lda #$2D
1e312b144f4d Major changes:
boisy
parents:
diff changeset
118 bra L00D0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
119 L00C0 cmpa #$60
1e312b144f4d Major changes:
boisy
parents:
diff changeset
120 bcs L00C8
1e312b144f4d Major changes:
boisy
parents:
diff changeset
121 suba #$60
1e312b144f4d Major changes:
boisy
parents:
diff changeset
122 bra L00D0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
123 L00C8 cmpa #$40
1e312b144f4d Major changes:
boisy
parents:
diff changeset
124 bcs L00CE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
125 suba #$40
1e312b144f4d Major changes:
boisy
parents:
diff changeset
126 L00CE eora #$40
1e312b144f4d Major changes:
boisy
parents:
diff changeset
127 L00D0 ldx <V.CrsrA,u get cursor address in X
1e312b144f4d Major changes:
boisy
parents:
diff changeset
128 sta ,x+ store character at address
1e312b144f4d Major changes:
boisy
parents:
diff changeset
129 stx <V.CrsrA,u update cursor address
1e312b144f4d Major changes:
boisy
parents:
diff changeset
130 cmpx <V.ScrnE,u end of screen?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
131 bcs L00DF branch if not
1e312b144f4d Major changes:
boisy
parents:
diff changeset
132 bsr SScrl else if at end of screen, scroll it
1e312b144f4d Major changes:
boisy
parents:
diff changeset
133 L00DF bsr ShowCrsr ends with a CLRB/RTS anyhow
1e312b144f4d Major changes:
boisy
parents:
diff changeset
134
1e312b144f4d Major changes:
boisy
parents:
diff changeset
135 * no operation entry point
1e312b144f4d Major changes:
boisy
parents:
diff changeset
136 NoOp clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
137 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
138
1e312b144f4d Major changes:
boisy
parents:
diff changeset
139 * Screen Scroll Routine
1e312b144f4d Major changes:
boisy
parents:
diff changeset
140 SScrl ldx <V.ScrnA,u get address of screen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
141 leax <32,x move to 2nd line
1e312b144f4d Major changes:
boisy
parents:
diff changeset
142 L00E9 ldd ,x++ copy from this line
1e312b144f4d Major changes:
boisy
parents:
diff changeset
143 std <-34,x to prevous
1e312b144f4d Major changes:
boisy
parents:
diff changeset
144 cmpx <V.ScrnE,u at end of screen yet?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
145 bcs L00E9 branch if not
1e312b144f4d Major changes:
boisy
parents:
diff changeset
146 leax <-32,x else back up one line
1e312b144f4d Major changes:
boisy
parents:
diff changeset
147 stx <V.CrsrA,u save address of cursor (first col of last row)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
148 lda #32 clear out row...
1e312b144f4d Major changes:
boisy
parents:
diff changeset
149 ldb #$60 ...width spaces
1e312b144f4d Major changes:
boisy
parents:
diff changeset
150 L00FD stb ,x+ do it...
1e312b144f4d Major changes:
boisy
parents:
diff changeset
151 deca end of rope?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
152 bne L00FD branch if not
1e312b144f4d Major changes:
boisy
parents:
diff changeset
153 L0102 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
154
1e312b144f4d Major changes:
boisy
parents:
diff changeset
155 Dispatch cmpa #$1B escape code?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
156 bcc bad@ branch if same or greater
1e312b144f4d Major changes:
boisy
parents:
diff changeset
157 cmpa #$0E $0E?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
158 bhi L0102 branch if higher than
1e312b144f4d Major changes:
boisy
parents:
diff changeset
159 leax <DCodeTbl,pcr deal with screen codes
1e312b144f4d Major changes:
boisy
parents:
diff changeset
160 lsla adjust for table entry size
1e312b144f4d Major changes:
boisy
parents:
diff changeset
161 ldd a,x get address in D
1e312b144f4d Major changes:
boisy
parents:
diff changeset
162 jmp d,x and jump to routine
1e312b144f4d Major changes:
boisy
parents:
diff changeset
163 bad@ comb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
164 ldb #E$Write
1e312b144f4d Major changes:
boisy
parents:
diff changeset
165 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
166
1e312b144f4d Major changes:
boisy
parents:
diff changeset
167 * display functions dispatch table
1e312b144f4d Major changes:
boisy
parents:
diff changeset
168 DCodeTbl fdb NoOp-DCodeTbl $00:no-op (null)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
169 fdb CurHome-DCodeTbl $01:HOME cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
170 fdb CurXY-DCodeTbl $02:CURSOR XY
1e312b144f4d Major changes:
boisy
parents:
diff changeset
171 fdb DelLine-DCodeTbl $03:ERASE LINE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
172 fdb ErEOLine-DCodeTbl $04:CLEAR TO EOL
1e312b144f4d Major changes:
boisy
parents:
diff changeset
173 fdb Do05-DCodeTbl $05:CURSOR ON/OFF
1e312b144f4d Major changes:
boisy
parents:
diff changeset
174 fdb CurRght-DCodeTbl $005e $06:CURSOR RIGHT
1e312b144f4d Major changes:
boisy
parents:
diff changeset
175 fdb NoOp-DCodeTbl $07:no-op (bel:handled in VTIO)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
176 fdb CurLeft-DCodeTbl $0050 $08:CURSOR LEFT
1e312b144f4d Major changes:
boisy
parents:
diff changeset
177 fdb CurUp-DCodeTbl $0119 $09:CURSOR UP
1e312b144f4d Major changes:
boisy
parents:
diff changeset
178 fdb CurDown-DCodeTbl $0038 $0A:CURSOR DOWN
1e312b144f4d Major changes:
boisy
parents:
diff changeset
179 fdb ErEOScrn-DCodeTbl $006c $0B:ERASE TO EOS
1e312b144f4d Major changes:
boisy
parents:
diff changeset
180 fdb ClrScrn-DCodeTbl $0070 $0C:CLEAR SCREEN
1e312b144f4d Major changes:
boisy
parents:
diff changeset
181 fdb Retrn-DCodeTbl $001e $0D:RETURN
1e312b144f4d Major changes:
boisy
parents:
diff changeset
182 fdb DoAlpha-DCodeTbl $012a $0E:DISPLAY ALPHA
1e312b144f4d Major changes:
boisy
parents:
diff changeset
183
1e312b144f4d Major changes:
boisy
parents:
diff changeset
184 * $0D - move cursor to start of line (carriage return)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
185 Retrn bsr HideCrsr hide cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
186 tfr x,d put cursor address in D
1e312b144f4d Major changes:
boisy
parents:
diff changeset
187 andb #$E0 place at start of line
1e312b144f4d Major changes:
boisy
parents:
diff changeset
188 stb <V.CrsAL,u and save low cursor address
1e312b144f4d Major changes:
boisy
parents:
diff changeset
189 ShowCrsr ldx <V.CrsrA,u get cursor address
1e312b144f4d Major changes:
boisy
parents:
diff changeset
190 lda ,x get char at cursor position
1e312b144f4d Major changes:
boisy
parents:
diff changeset
191 sta <V.CChar,u save it
1e312b144f4d Major changes:
boisy
parents:
diff changeset
192 lda <V.CColr,u get cursor character
1e312b144f4d Major changes:
boisy
parents:
diff changeset
193 beq L014D branch if none
1e312b144f4d Major changes:
boisy
parents:
diff changeset
194 L014B sta ,x else turn on cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
195 L014D clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
196 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
197
1e312b144f4d Major changes:
boisy
parents:
diff changeset
198 * $0A - cursor down (line feed)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
199 CurDown bsr HideCrsr hide cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
200 leax <32,x move X down one line
1e312b144f4d Major changes:
boisy
parents:
diff changeset
201 cmpx <V.ScrnE,u at end of screen?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
202 bcs L0162 branch if not
1e312b144f4d Major changes:
boisy
parents:
diff changeset
203 leax <-32,x else go back up one line
1e312b144f4d Major changes:
boisy
parents:
diff changeset
204 pshs x save X
1e312b144f4d Major changes:
boisy
parents:
diff changeset
205 bsr SScrl and scroll the screen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
206 puls x restore pointer
1e312b144f4d Major changes:
boisy
parents:
diff changeset
207 L0162 stx <V.CrsrA,u save cursor pointer
1e312b144f4d Major changes:
boisy
parents:
diff changeset
208 bra ShowCrsr show cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
209
1e312b144f4d Major changes:
boisy
parents:
diff changeset
210 * $08 - cursor left
1e312b144f4d Major changes:
boisy
parents:
diff changeset
211 CurLeft bsr HideCrsr hide cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
212 cmpx <V.ScrnA,u compare against start of screen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
213 bls L0173 ignore it if at the screen start
1e312b144f4d Major changes:
boisy
parents:
diff changeset
214 leax -$01,x else back up one
1e312b144f4d Major changes:
boisy
parents:
diff changeset
215 stx <V.CrsrA,u save updated pointer
1e312b144f4d Major changes:
boisy
parents:
diff changeset
216 L0173 bra ShowCrsr and show cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
217
1e312b144f4d Major changes:
boisy
parents:
diff changeset
218 * $06 - cursor right
1e312b144f4d Major changes:
boisy
parents:
diff changeset
219 CurRght bsr HideCrsr hide cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
220 leax $01,x move to the right
1e312b144f4d Major changes:
boisy
parents:
diff changeset
221 cmpx <V.ScrnE,u compare against end of screen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
222 bcc L0181 if past end, ignore it
1e312b144f4d Major changes:
boisy
parents:
diff changeset
223 stx <V.CrsrA,u else save updated pointer
1e312b144f4d Major changes:
boisy
parents:
diff changeset
224 L0181 bra ShowCrsr and show cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
225
1e312b144f4d Major changes:
boisy
parents:
diff changeset
226 * $0B - erase to end of screen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
227 ErEOScrn bsr HideCrsr kill the cusror
1e312b144f4d Major changes:
boisy
parents:
diff changeset
228 bra L0189 and clear rest of the screen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
229
1e312b144f4d Major changes:
boisy
parents:
diff changeset
230 * $0C - clear screen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
231 ClrScrn bsr CurHome home cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
232 L0189 lda #$60 get default char
1e312b144f4d Major changes:
boisy
parents:
diff changeset
233 L018B sta ,x+ save at location
1e312b144f4d Major changes:
boisy
parents:
diff changeset
234 cmpx <V.ScrnE,u end of screen?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
235 bcs L018B branch if not
1e312b144f4d Major changes:
boisy
parents:
diff changeset
236 bra ShowCrsr now show cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
237
1e312b144f4d Major changes:
boisy
parents:
diff changeset
238 * $01 - home cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
239 CurHome bsr HideCrsr hide cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
240 ldx <V.ScrnA,u $1D get pointer to screen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
241 stx <V.CrsrA,u $21 save as new cursor position
1e312b144f4d Major changes:
boisy
parents:
diff changeset
242 bra ShowCrsr and show it
1e312b144f4d Major changes:
boisy
parents:
diff changeset
243
1e312b144f4d Major changes:
boisy
parents:
diff changeset
244 * Hides the cursor from the screen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
245 * Exit: X = address of cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
246 HideCrsr ldx <V.CrsrA,u $21 get address of cursor in X
1e312b144f4d Major changes:
boisy
parents:
diff changeset
247 lda <V.CChar,u $23 get value of char under cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
248 sta ,x put char in place of cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
249 clrb must be here, in general, for [...] BRA HideCrsr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
250 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
251
1e312b144f4d Major changes:
boisy
parents:
diff changeset
252 * $05 XX - set cursor off/on/color per XX-32
1e312b144f4d Major changes:
boisy
parents:
diff changeset
253 Do05 ldb #$01 need additional byte
1e312b144f4d Major changes:
boisy
parents:
diff changeset
254 leax <CrsrSw,pcr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
255 bra L01E5
1e312b144f4d Major changes:
boisy
parents:
diff changeset
256
1e312b144f4d Major changes:
boisy
parents:
diff changeset
257 CrsrSw lda <V.NChr2,u get next char
1e312b144f4d Major changes:
boisy
parents:
diff changeset
258 suba #C$SPAC take out ASCII space
1e312b144f4d Major changes:
boisy
parents:
diff changeset
259 bne L01BB branch if not zero
1e312b144f4d Major changes:
boisy
parents:
diff changeset
260 sta <V.CColr,u else save cursor color zero (no cursor)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
261 bra HideCrsr and hide cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
262 L01BB cmpa #$0B greater than $0B?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
263 bge L014D yep, just ignore byte
1e312b144f4d Major changes:
boisy
parents:
diff changeset
264 cmpa #$01 is it one?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
265 bgt L01C7 branch if greater
1e312b144f4d Major changes:
boisy
parents:
diff changeset
266 lda #$AF else get default blue cursor color
1e312b144f4d Major changes:
boisy
parents:
diff changeset
267 bra L01D7 and save cursor color
1e312b144f4d Major changes:
boisy
parents:
diff changeset
268 L01C7 cmpa #$02 is it two?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
269 bgt L01CF branch if larger
1e312b144f4d Major changes:
boisy
parents:
diff changeset
270 lda #$A0 else get black cursor color
1e312b144f4d Major changes:
boisy
parents:
diff changeset
271 bra L01D7 and save it
1e312b144f4d Major changes:
boisy
parents:
diff changeset
272 ** BUG ** BUG ** BUG ** BUG
1e312b144f4d Major changes:
boisy
parents:
diff changeset
273 L01CF suba #$03 ** BUG FIXED! ** !!! Was SUBB
1e312b144f4d Major changes:
boisy
parents:
diff changeset
274 lsla shift into upper nibble
1e312b144f4d Major changes:
boisy
parents:
diff changeset
275 lsla
1e312b144f4d Major changes:
boisy
parents:
diff changeset
276 lsla
1e312b144f4d Major changes:
boisy
parents:
diff changeset
277 lsla
1e312b144f4d Major changes:
boisy
parents:
diff changeset
278 ora #$8F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
279 L01D7 sta <V.CColr,u save new cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
280 ldx <V.CrsrA,u get cursor address
1e312b144f4d Major changes:
boisy
parents:
diff changeset
281 lbra L014B branch to save cursor in X
1e312b144f4d Major changes:
boisy
parents:
diff changeset
282
1e312b144f4d Major changes:
boisy
parents:
diff changeset
283 * $02 XX YY - move cursor to col XX-32, row YY-32
1e312b144f4d Major changes:
boisy
parents:
diff changeset
284 CurXY ldb #$02 we want to claim next two chars
1e312b144f4d Major changes:
boisy
parents:
diff changeset
285 leax <DoCurXY,pcr point to processing routine
1e312b144f4d Major changes:
boisy
parents:
diff changeset
286 L01E5 stx <V.RTAdd,u store routine to return to
1e312b144f4d Major changes:
boisy
parents:
diff changeset
287 stb <V.NGChr,u get two more chars
1e312b144f4d Major changes:
boisy
parents:
diff changeset
288 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
289 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
290
1e312b144f4d Major changes:
boisy
parents:
diff changeset
291 DoCurXY bsr HideCrsr hide cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
292 ldb <V.NChr2,u get ASCII Y-pos
1e312b144f4d Major changes:
boisy
parents:
diff changeset
293 subb #C$SPAC take out ASCII space
1e312b144f4d Major changes:
boisy
parents:
diff changeset
294 lda #32 go down
1e312b144f4d Major changes:
boisy
parents:
diff changeset
295 mul multiply it
1e312b144f4d Major changes:
boisy
parents:
diff changeset
296 addb <V.NChar,u add in X-pos
1e312b144f4d Major changes:
boisy
parents:
diff changeset
297 adca #$00
1e312b144f4d Major changes:
boisy
parents:
diff changeset
298 subd #C$SPAC take out another ASCII space
1e312b144f4d Major changes:
boisy
parents:
diff changeset
299 addd <V.ScrnA,u add top of screen address
1e312b144f4d Major changes:
boisy
parents:
diff changeset
300 cmpd <V.ScrnE,u at end of the screen?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
301 lbcc L014D exit if off the screen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
302 std <V.CrsrA,u otherwise save new cursor address
1e312b144f4d Major changes:
boisy
parents:
diff changeset
303 lbra ShowCrsr and show cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
304
1e312b144f4d Major changes:
boisy
parents:
diff changeset
305 * $04 - erase to end of line
1e312b144f4d Major changes:
boisy
parents:
diff changeset
306 ErEOLine bsr HideCrsr hide cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
307 tfr x,d move current cursor position in D
1e312b144f4d Major changes:
boisy
parents:
diff changeset
308 andb #$1F number of characters put on this line
1e312b144f4d Major changes:
boisy
parents:
diff changeset
309 pshs b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
310 ldb #32
1e312b144f4d Major changes:
boisy
parents:
diff changeset
311 subb ,s+
1e312b144f4d Major changes:
boisy
parents:
diff changeset
312 bra L0223 and clear one line
1e312b144f4d Major changes:
boisy
parents:
diff changeset
313
1e312b144f4d Major changes:
boisy
parents:
diff changeset
314 * $03 - erase line
1e312b144f4d Major changes:
boisy
parents:
diff changeset
315 DelLine lbsr Retrn do a CR
1e312b144f4d Major changes:
boisy
parents:
diff changeset
316 ldb #32 line length
1e312b144f4d Major changes:
boisy
parents:
diff changeset
317 L0223 lda #$60 get default character
1e312b144f4d Major changes:
boisy
parents:
diff changeset
318 ldx <V.CrsrA,u get cursor address
1e312b144f4d Major changes:
boisy
parents:
diff changeset
319 L0228 sta ,x+ fill screen line with 'space'
1e312b144f4d Major changes:
boisy
parents:
diff changeset
320 decb decrement
1e312b144f4d Major changes:
boisy
parents:
diff changeset
321 bne L0228 and branch if not end
1e312b144f4d Major changes:
boisy
parents:
diff changeset
322 lbra ShowCrsr else show cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
323
1e312b144f4d Major changes:
boisy
parents:
diff changeset
324 * $09 - cursor up
1e312b144f4d Major changes:
boisy
parents:
diff changeset
325 CurUp lbsr HideCrsr hide cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
326 leax <-32,x move X up one line
1e312b144f4d Major changes:
boisy
parents:
diff changeset
327 cmpx <V.ScrnA,u compare against start of screen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
328 bcs L023E branch if we went beyond
1e312b144f4d Major changes:
boisy
parents:
diff changeset
329 stx <V.CrsrA,u else store updated X
1e312b144f4d Major changes:
boisy
parents:
diff changeset
330 L023E lbra ShowCrsr and show cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
331
1e312b144f4d Major changes:
boisy
parents:
diff changeset
332 * $0E - switch screen to alphanumeric mode
1e312b144f4d Major changes:
boisy
parents:
diff changeset
333 DoAlpha clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
334 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
335 jmp [<V.DspVct,u] display screen (routine in VTIO)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
336
1e312b144f4d Major changes:
boisy
parents:
diff changeset
337 * GetStat
1e312b144f4d Major changes:
boisy
parents:
diff changeset
338 GetStat ldx PD.RGS,y get caller's regs
1e312b144f4d Major changes:
boisy
parents:
diff changeset
339 cmpa #SS.AlfaS AlfaS?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
340 beq Rt.AlfaS branch if so
1e312b144f4d Major changes:
boisy
parents:
diff changeset
341 cmpa #SS.Cursr Cursr?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
342 beq Rt.Cursr branch if so
1e312b144f4d Major changes:
boisy
parents:
diff changeset
343
1e312b144f4d Major changes:
boisy
parents:
diff changeset
344 * SetStat
1e312b144f4d Major changes:
boisy
parents:
diff changeset
345 SetStat comb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
346 ldb #E$UnkSvc
1e312b144f4d Major changes:
boisy
parents:
diff changeset
347 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
348
1e312b144f4d Major changes:
boisy
parents:
diff changeset
349 * SS.AlfaS getstat
1e312b144f4d Major changes:
boisy
parents:
diff changeset
350 Rt.AlfaS ldd <V.ScrnA,u memory address of buffer
1e312b144f4d Major changes:
boisy
parents:
diff changeset
351 std R$X,x save in caller's X
1e312b144f4d Major changes:
boisy
parents:
diff changeset
352 ldd <V.CrsrA,u get cursor address
1e312b144f4d Major changes:
boisy
parents:
diff changeset
353 std R$Y,x save in caller's Y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
354 lda <V.Caps,u save caps lock status in A and exit
1e312b144f4d Major changes:
boisy
parents:
diff changeset
355 bra SaveA
1e312b144f4d Major changes:
boisy
parents:
diff changeset
356
1e312b144f4d Major changes:
boisy
parents:
diff changeset
357 * SS.Cursr getstat
1e312b144f4d Major changes:
boisy
parents:
diff changeset
358 Rt.Cursr ldd <V.CrsrA,u get address of cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
359 subd <V.ScrnA,u subtract screen address
1e312b144f4d Major changes:
boisy
parents:
diff changeset
360 pshs b,a D now holds cursor position relative to screen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
361 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
362 andb #$1F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
363 addb #$20 compute column position
1e312b144f4d Major changes:
boisy
parents:
diff changeset
364 std R$X,x save column position to caller's X
1e312b144f4d Major changes:
boisy
parents:
diff changeset
365 puls b,a then divide by 32
1e312b144f4d Major changes:
boisy
parents:
diff changeset
366 lsra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
367 rolb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
368 rolb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
369 rolb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
370 rolb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
371 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
372 andb #$0F only 16 line to a screen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
373 addb #$20
1e312b144f4d Major changes:
boisy
parents:
diff changeset
374 std R$Y,x and save column to caller's Y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
375 ldb <V.CFlag,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
376 lda <V.CChar,u get character under cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
377 bmi SaveA if hi bit set, go on
1e312b144f4d Major changes:
boisy
parents:
diff changeset
378 cmpa #$60 VDG space?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
379 bcc L02A5 branch if greater than
1e312b144f4d Major changes:
boisy
parents:
diff changeset
380 cmpa #$20
1e312b144f4d Major changes:
boisy
parents:
diff changeset
381 bcc L02A9
1e312b144f4d Major changes:
boisy
parents:
diff changeset
382 tstb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
383 beq L02A3
1e312b144f4d Major changes:
boisy
parents:
diff changeset
384 cmpa #$00
1e312b144f4d Major changes:
boisy
parents:
diff changeset
385 bne L029B
1e312b144f4d Major changes:
boisy
parents:
diff changeset
386 lda #$5E
1e312b144f4d Major changes:
boisy
parents:
diff changeset
387 bra SaveA save it and exit
1e312b144f4d Major changes:
boisy
parents:
diff changeset
388
1e312b144f4d Major changes:
boisy
parents:
diff changeset
389 L029B cmpa #$1F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
390 bne L02A3
1e312b144f4d Major changes:
boisy
parents:
diff changeset
391 lda #$5F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
392 bra SaveA
1e312b144f4d Major changes:
boisy
parents:
diff changeset
393 L02A3 ora #$20 turn it into ASCII from VDG codes
1e312b144f4d Major changes:
boisy
parents:
diff changeset
394 L02A5 eora #$40
1e312b144f4d Major changes:
boisy
parents:
diff changeset
395 bra SaveA
1e312b144f4d Major changes:
boisy
parents:
diff changeset
396 L02A9 tstb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
397 bne SaveA
1e312b144f4d Major changes:
boisy
parents:
diff changeset
398 cmpa #$21 remap specific codes
1e312b144f4d Major changes:
boisy
parents:
diff changeset
399 bne L02B4
1e312b144f4d Major changes:
boisy
parents:
diff changeset
400 lda #$7C
1e312b144f4d Major changes:
boisy
parents:
diff changeset
401 bra SaveA
1e312b144f4d Major changes:
boisy
parents:
diff changeset
402 L02B4 cmpa #$2D
1e312b144f4d Major changes:
boisy
parents:
diff changeset
403 bne SaveA
1e312b144f4d Major changes:
boisy
parents:
diff changeset
404 lda #$7E
1e312b144f4d Major changes:
boisy
parents:
diff changeset
405 SaveA sta R$A,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
406 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
407 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
408
1e312b144f4d Major changes:
boisy
parents:
diff changeset
409 emod
1e312b144f4d Major changes:
boisy
parents:
diff changeset
410 eom equ *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
411 end
1e312b144f4d Major changes:
boisy
parents:
diff changeset
412