annotate level1/modules/cohr.asm @ 2242:2a889a511f0a

Adding Aaron Wolfe's DriveWire work
author boisy
date Thu, 24 Dec 2009 01:16:31 +0000
parents 3176d0ac7213
children b8c7b7fbf3c9
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 * CoHR - Hi-Res 51x24 Graphics 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 * Original Dragon distribution version
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 fcb arrays, added labels & some comments
1e312b144f4d Major changes:
boisy
parents:
diff changeset
14 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
15 * 2004/11/15 P.Harvey-Smith
1e312b144f4d Major changes:
boisy
parents:
diff changeset
16 * Added code to turn off the drives on the Dragon Alpha.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
17 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
18 * 2004/12/01 P.Harvey-Smith
1e312b144f4d Major changes:
boisy
parents:
diff changeset
19 * Began converting drvr51 to CoHR, removed all keyboard
1e312b144f4d Major changes:
boisy
parents:
diff changeset
20 * related code, added symbolic defines for a lot of things.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
21 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
22 * 2004/12/02 P.Harvey-Smith
1e312b144f4d Major changes:
boisy
parents:
diff changeset
23 * Finished converting to c051 driver, moved all variable
1e312b144f4d Major changes:
boisy
parents:
diff changeset
24 * storage into ccio module (defined in cciodefs).
1e312b144f4d Major changes:
boisy
parents:
diff changeset
25 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
26 * 2005/04/09 P.Harvey-Smith
1e312b144f4d Major changes:
boisy
parents:
diff changeset
27 * Replaced all ; comment chars with * for benefit of native
1e312b144f4d Major changes:
boisy
parents:
diff changeset
28 * asm. Re-implemented (hopefully) non-destructive cursor which
1e312b144f4d Major changes:
boisy
parents:
diff changeset
29 * is XORed onto the screen. Commented character drawing routines
1e312b144f4d Major changes:
boisy
parents:
diff changeset
30 * and replaced the V51xx names with more meaningful ones.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
31 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
32 * 2005/04/24 P.Harvey-Smith
1e312b144f4d Major changes:
boisy
parents:
diff changeset
33 * Addded routines to flash the cursor, this is as it was in the
1e312b144f4d Major changes:
boisy
parents:
diff changeset
34 * Dragon Data 51 column driver.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
35 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
36 nam CoHR
1e312b144f4d Major changes:
boisy
parents:
diff changeset
37 ttl Hi-Res 51x24 Graphics Console Output Subroutine for VTIO
1e312b144f4d Major changes:
boisy
parents:
diff changeset
38
1e312b144f4d Major changes:
boisy
parents:
diff changeset
39 ifp1
2032
3176d0ac7213 Rearranging directory for ports
boisy
parents: 1933
diff changeset
40 use defsfile
1933
1e312b144f4d Major changes:
boisy
parents:
diff changeset
41 use vtiodefs
1e312b144f4d Major changes:
boisy
parents:
diff changeset
42 endc
1e312b144f4d Major changes:
boisy
parents:
diff changeset
43
1e312b144f4d Major changes:
boisy
parents:
diff changeset
44 tylg set Systm+Objct
1e312b144f4d Major changes:
boisy
parents:
diff changeset
45 atrv set ReEnt+rev
1e312b144f4d Major changes:
boisy
parents:
diff changeset
46 rev set $00
1e312b144f4d Major changes:
boisy
parents:
diff changeset
47 edition set 1
1e312b144f4d Major changes:
boisy
parents:
diff changeset
48
1e312b144f4d Major changes:
boisy
parents:
diff changeset
49 mod eom,name,tylg,atrv,start,size
1e312b144f4d Major changes:
boisy
parents:
diff changeset
50
1e312b144f4d Major changes:
boisy
parents:
diff changeset
51 size equ .
1e312b144f4d Major changes:
boisy
parents:
diff changeset
52
1e312b144f4d Major changes:
boisy
parents:
diff changeset
53 fcb UPDAT.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
54
1e312b144f4d Major changes:
boisy
parents:
diff changeset
55
1e312b144f4d Major changes:
boisy
parents:
diff changeset
56 ScreenSize equ $1800 * Screen Size in Bytes
1e312b144f4d Major changes:
boisy
parents:
diff changeset
57
1e312b144f4d Major changes:
boisy
parents:
diff changeset
58 name fcs /CoHR/
1e312b144f4d Major changes:
boisy
parents:
diff changeset
59 fcb edition
1e312b144f4d Major changes:
boisy
parents:
diff changeset
60
1e312b144f4d Major changes:
boisy
parents:
diff changeset
61 start lbra Init
1e312b144f4d Major changes:
boisy
parents:
diff changeset
62 lbra Write
1e312b144f4d Major changes:
boisy
parents:
diff changeset
63 lbra GetStat
1e312b144f4d Major changes:
boisy
parents:
diff changeset
64 lbra SetStat
1e312b144f4d Major changes:
boisy
parents:
diff changeset
65 lbra Term
1e312b144f4d Major changes:
boisy
parents:
diff changeset
66
1e312b144f4d Major changes:
boisy
parents:
diff changeset
67 Init
1e312b144f4d Major changes:
boisy
parents:
diff changeset
68 pshs u,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
69 ldd #ScreenSize+$100 * Request a screenful of ram + $100 bytes
1e312b144f4d Major changes:
boisy
parents:
diff changeset
70 os9 F$SRqMem
1e312b144f4d Major changes:
boisy
parents:
diff changeset
71 bcs InitExit * Error : exit
1e312b144f4d Major changes:
boisy
parents:
diff changeset
72 tfr u,d
1e312b144f4d Major changes:
boisy
parents:
diff changeset
73 ldu $01,s * Restore saved u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
74 tfr d,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
75 bita #$01 * Check that memory block starts at even page
1e312b144f4d Major changes:
boisy
parents:
diff changeset
76 beq L0066 * Yes base of screen = base of memory block
1e312b144f4d Major changes:
boisy
parents:
diff changeset
77 leax >$0100,x * no Move to next page
1e312b144f4d Major changes:
boisy
parents:
diff changeset
78 bra L0068
1e312b144f4d Major changes:
boisy
parents:
diff changeset
79 L0066 adda #$18
1e312b144f4d Major changes:
boisy
parents:
diff changeset
80 L0068 stx V.51ScrnA,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
81 tfr d,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
82 ldd #$0100
1e312b144f4d Major changes:
boisy
parents:
diff changeset
83 os9 F$SRtMem * Return unneeded page to OS
1e312b144f4d Major changes:
boisy
parents:
diff changeset
84 ldu $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
85
1e312b144f4d Major changes:
boisy
parents:
diff changeset
86 clr V.51CursorOn,u * Flag cursor off
1e312b144f4d Major changes:
boisy
parents:
diff changeset
87 lbsr DoHome
1e312b144f4d Major changes:
boisy
parents:
diff changeset
88 lbsr DoReverseOff
1e312b144f4d Major changes:
boisy
parents:
diff changeset
89 lbsr DoCLS
1e312b144f4d Major changes:
boisy
parents:
diff changeset
90 ldb V.COLoad,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
91 orb #ModCoHR * set to CoHR found (?)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
92
1e312b144f4d Major changes:
boisy
parents:
diff changeset
93 leax FlashCursor,pcr * Get address of cursor flash routine
1e312b144f4d Major changes:
boisy
parents:
diff changeset
94 stx V.Flash,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
95
1e312b144f4d Major changes:
boisy
parents:
diff changeset
96 InitSaveExit
1e312b144f4d Major changes:
boisy
parents:
diff changeset
97 stb V.COLoad,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
98 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
99
1e312b144f4d Major changes:
boisy
parents:
diff changeset
100 InitExit
1e312b144f4d Major changes:
boisy
parents:
diff changeset
101 puls pc,u,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
102
1e312b144f4d Major changes:
boisy
parents:
diff changeset
103 InitFlag fcb $00
1e312b144f4d Major changes:
boisy
parents:
diff changeset
104
1e312b144f4d Major changes:
boisy
parents:
diff changeset
105 Term pshs y,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
106 pshs u * save U
1e312b144f4d Major changes:
boisy
parents:
diff changeset
107 ldd #ScreenSize * Graphics memory size
1e312b144f4d Major changes:
boisy
parents:
diff changeset
108 ldu V.51ScrnA,u * get pointer to memory
1e312b144f4d Major changes:
boisy
parents:
diff changeset
109 os9 F$SRtMem * return to system
1e312b144f4d Major changes:
boisy
parents:
diff changeset
110 puls u * restore U
1e312b144f4d Major changes:
boisy
parents:
diff changeset
111 ldb V.COLoad,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
112 andb #~ModCoHR * Set CoHR unot loaded
1e312b144f4d Major changes:
boisy
parents:
diff changeset
113 bra InitSaveExit
1e312b144f4d Major changes:
boisy
parents:
diff changeset
114
1e312b144f4d Major changes:
boisy
parents:
diff changeset
115 * Write
1e312b144f4d Major changes:
boisy
parents:
diff changeset
116 * Entry: A = char to write
1e312b144f4d Major changes:
boisy
parents:
diff changeset
117 * Y = path desc ptr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
118
1e312b144f4d Major changes:
boisy
parents:
diff changeset
119 Write
1e312b144f4d Major changes:
boisy
parents:
diff changeset
120
1e312b144f4d Major changes:
boisy
parents:
diff changeset
121 L012C inc V.Noflash,u * Flag do not flash cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
122 ldb V.51EscSeq,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
123 bne L0165
1e312b144f4d Major changes:
boisy
parents:
diff changeset
124 cmpa #$1B * escape?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
125 bne CheckForNormal
1e312b144f4d Major changes:
boisy
parents:
diff changeset
126 inc V.51EscSeq,u * flag ESC seq
1e312b144f4d Major changes:
boisy
parents:
diff changeset
127
1e312b144f4d Major changes:
boisy
parents:
diff changeset
128 WriteExit2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
129 clr V.NoFlash,u * Allow cursor to flash
1e312b144f4d Major changes:
boisy
parents:
diff changeset
130 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
131 L0139 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
132
1e312b144f4d Major changes:
boisy
parents:
diff changeset
133
1e312b144f4d Major changes:
boisy
parents:
diff changeset
134 CheckForNormal
1e312b144f4d Major changes:
boisy
parents:
diff changeset
135 cmpa #$20
1e312b144f4d Major changes:
boisy
parents:
diff changeset
136 bcs DoCtrlChar * Control charater ?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
137 cmpa #$7F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
138 bcc DoCtrlChar * or upper bit set
1e312b144f4d Major changes:
boisy
parents:
diff changeset
139 bra DoNormalChar
1e312b144f4d Major changes:
boisy
parents:
diff changeset
140
1e312b144f4d Major changes:
boisy
parents:
diff changeset
141 DoCtrlChar
1e312b144f4d Major changes:
boisy
parents:
diff changeset
142 leax >CtrlCharDispatch,pcr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
143 L0148 tst ,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
144 bne L0150
1e312b144f4d Major changes:
boisy
parents:
diff changeset
145 CancelEscSequence
1e312b144f4d Major changes:
boisy
parents:
diff changeset
146 clr V.51EscSeq,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
147 WriteExit
1e312b144f4d Major changes:
boisy
parents:
diff changeset
148 clr V.NoFlash,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
149 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
150
1e312b144f4d Major changes:
boisy
parents:
diff changeset
151 L0150 cmpa ,x+
1e312b144f4d Major changes:
boisy
parents:
diff changeset
152 bne L0161
1e312b144f4d Major changes:
boisy
parents:
diff changeset
153 ldd ,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
154 leax >CtrlCharDispatch,pcr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
155 leax d,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
156 stx V.51CtrlDispatch,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
157 jsr ,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
158 bra WriteExit
1e312b144f4d Major changes:
boisy
parents:
diff changeset
159
1e312b144f4d Major changes:
boisy
parents:
diff changeset
160 L0161 leax $02,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
161 bra L0148
1e312b144f4d Major changes:
boisy
parents:
diff changeset
162
1e312b144f4d Major changes:
boisy
parents:
diff changeset
163 L0165 inc V.51EscSeq,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
164 leax >EscCharDispatch,pcr
1e312b144f4d Major changes:
boisy
parents:
diff changeset
165 cmpb #$01
1e312b144f4d Major changes:
boisy
parents:
diff changeset
166 beq L0148
1e312b144f4d Major changes:
boisy
parents:
diff changeset
167 jmp [V.51CtrlDispatch,u]
1e312b144f4d Major changes:
boisy
parents:
diff changeset
168
1e312b144f4d Major changes:
boisy
parents:
diff changeset
169 DoNormalChar
1e312b144f4d Major changes:
boisy
parents:
diff changeset
170 pshs y,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
171 lbsr DoEraseCursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
172 puls y,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
173 inc V.51CursorChanged,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
174 bsr DrawCharacter
1e312b144f4d Major changes:
boisy
parents:
diff changeset
175 tst V.51UnderlineFlag,u * Are we underlining ?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
176 beq L0185 * no : update cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
177 lda #$F8 * Yes : do underline, then update cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
178 leay <-$40,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
179 lbsr L0236
1e312b144f4d Major changes:
boisy
parents:
diff changeset
180
1e312b144f4d Major changes:
boisy
parents:
diff changeset
181 L0185 lda V.51XPos,u * Get current X pos
1e312b144f4d Major changes:
boisy
parents:
diff changeset
182 inca * increment it
1e312b144f4d Major changes:
boisy
parents:
diff changeset
183 cmpa #$33 * past end of line ?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
184 bcs L01A2 * no : continue
1e312b144f4d Major changes:
boisy
parents:
diff changeset
185 clr V.51XPos,u * Yes reset x=0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
186 lda V.51YPos,u * increment y pos
1e312b144f4d Major changes:
boisy
parents:
diff changeset
187 inca
1e312b144f4d Major changes:
boisy
parents:
diff changeset
188 cmpa #$18 * Past last line ?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
189 bcs L019D * No : continue
1e312b144f4d Major changes:
boisy
parents:
diff changeset
190 lbsr SoScrollScreen * Yes : scroll screen one line
1e312b144f4d Major changes:
boisy
parents:
diff changeset
191 bra L01A5
1e312b144f4d Major changes:
boisy
parents:
diff changeset
192 L019D sta V.51YPos,u * Ypdate Y pos
1e312b144f4d Major changes:
boisy
parents:
diff changeset
193 bra L01A5
1e312b144f4d Major changes:
boisy
parents:
diff changeset
194
1e312b144f4d Major changes:
boisy
parents:
diff changeset
195 L01A2 sta V.51XPos,u * Update X pos
1e312b144f4d Major changes:
boisy
parents:
diff changeset
196 L01A5
1e312b144f4d Major changes:
boisy
parents:
diff changeset
197 ldd V.51XPos,u * Update old Cursor pos
1e312b144f4d Major changes:
boisy
parents:
diff changeset
198 std V.51OldCursorPosX,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
199 dec V.51CursorChanged,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
200 lbsr DoDisplayCursor * Display cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
201
1e312b144f4d Major changes:
boisy
parents:
diff changeset
202 lbra WriteExit2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
203 clrb * Flag no error
1e312b144f4d Major changes:
boisy
parents:
diff changeset
204 rts * Return to caller
1e312b144f4d Major changes:
boisy
parents:
diff changeset
205
1e312b144f4d Major changes:
boisy
parents:
diff changeset
206 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
207 * Draw the normal character $20..$7f, in the a register
1e312b144f4d Major changes:
boisy
parents:
diff changeset
208 * at position stored in V.51Xpos,V.51Ypos
1e312b144f4d Major changes:
boisy
parents:
diff changeset
209 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
210
1e312b144f4d Major changes:
boisy
parents:
diff changeset
211 DrawCharacter
1e312b144f4d Major changes:
boisy
parents:
diff changeset
212 tfr a,b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
213 subb #$20 * Make b an offset into table
1e312b144f4d Major changes:
boisy
parents:
diff changeset
214 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
215 leax >CharacterShapes,pcr * point to character shape table
1e312b144f4d Major changes:
boisy
parents:
diff changeset
216 lslb * Multiply b by 4 into d (4 bytes/character)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
217 rola
1e312b144f4d Major changes:
boisy
parents:
diff changeset
218 lslb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
219 rola
1e312b144f4d Major changes:
boisy
parents:
diff changeset
220 leax d,x * Point X at required character's bitmap
1e312b144f4d Major changes:
boisy
parents:
diff changeset
221 ldb #$05 * Work out pixel X co-ordinate of current cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
222 lda V.51XPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
223 mul
1e312b144f4d Major changes:
boisy
parents:
diff changeset
224 pshs b * Save pixel x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
225 lsra * Divide pixel-x by 8, to get byte offset into line
1e312b144f4d Major changes:
boisy
parents:
diff changeset
226 rorb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
227 lsra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
228 rorb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
229 lsra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
230 rorb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
231 puls a * restore pixel X
1e312b144f4d Major changes:
boisy
parents:
diff changeset
232 anda #$07 * Calculate offset within byte where character begins
1e312b144f4d Major changes:
boisy
parents:
diff changeset
233 pshs b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
234 sta V.51BytePixOffset,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
235 tst V.51XORFlag,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
236 bne L01FF
1e312b144f4d Major changes:
boisy
parents:
diff changeset
237 tfr a,b * Calculate a mask for character data
1e312b144f4d Major changes:
boisy
parents:
diff changeset
238 lda #$F8 * shifts $f8 right b times
1e312b144f4d Major changes:
boisy
parents:
diff changeset
239 tstb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
240 beq L01FA * Done all bits ?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
241 L01E5 lsra * shift mask right
1e312b144f4d Major changes:
boisy
parents:
diff changeset
242 decb * decrement count
1e312b144f4d Major changes:
boisy
parents:
diff changeset
243 bhi L01E5 * done all ?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
244 bne L01EE * have we shifted any mask bits off right hand end ?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
245 rorb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
246 bra L01FA
1e312b144f4d Major changes:
boisy
parents:
diff changeset
247
1e312b144f4d Major changes:
boisy
parents:
diff changeset
248 L01EE pshs b * Save count on stack
1e312b144f4d Major changes:
boisy
parents:
diff changeset
249 ldb #$80 * start to build mask for second byte as well
1e312b144f4d Major changes:
boisy
parents:
diff changeset
250 L01F2 lsra * shift bits from bottom of a to top of b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
251 rorb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
252 dec ,s * decrement count
1e312b144f4d Major changes:
boisy
parents:
diff changeset
253 bne L01F2 * if any shifts left loop again
1e312b144f4d Major changes:
boisy
parents:
diff changeset
254 leas $01,s * drop count
1e312b144f4d Major changes:
boisy
parents:
diff changeset
255
1e312b144f4d Major changes:
boisy
parents:
diff changeset
256 * When we reach here we should have a pair of bytes in d which indicate where exactly the
1e312b144f4d Major changes:
boisy
parents:
diff changeset
257 * character should be drawn, this may be partly in each
1e312b144f4d Major changes:
boisy
parents:
diff changeset
258
1e312b144f4d Major changes:
boisy
parents:
diff changeset
259 L01FA coma
1e312b144f4d Major changes:
boisy
parents:
diff changeset
260 comb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
261 std V.51ScreenMask1,u * Save screen mask
1e312b144f4d Major changes:
boisy
parents:
diff changeset
262
1e312b144f4d Major changes:
boisy
parents:
diff changeset
263 * The code below works out the offset of the character cell to be updated, this works because
1e312b144f4d Major changes:
boisy
parents:
diff changeset
264 * the y co ordinate is loaded into the high byte of d, effectivley multiplying it by 256, since
1e312b144f4d Major changes:
boisy
parents:
diff changeset
265 * each screen line is 32 bytes wide, and each character is 8 pixels tall this works out as 8x32=256
1e312b144f4d Major changes:
boisy
parents:
diff changeset
266
1e312b144f4d Major changes:
boisy
parents:
diff changeset
267 L01FF ldy V.51ScrnA,u * Point y at screen memory address
1e312b144f4d Major changes:
boisy
parents:
diff changeset
268 lda V.51YPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
269 ldb ,s+ * Retrieve byte offset from stack
1e312b144f4d Major changes:
boisy
parents:
diff changeset
270 leay d,y * calculate screen address.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
271 lda #$04 * get character data byte count, 4 bytes of 8 nibbles
1e312b144f4d Major changes:
boisy
parents:
diff changeset
272 pshs a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
273 inc V.51CursorChanged,u * flag character at cursor being changed
1e312b144f4d Major changes:
boisy
parents:
diff changeset
274
1e312b144f4d Major changes:
boisy
parents:
diff changeset
275 L0211 lda ,x * get a byte from character data
1e312b144f4d Major changes:
boisy
parents:
diff changeset
276 anda #$F0 * mask out even line
1e312b144f4d Major changes:
boisy
parents:
diff changeset
277 bsr L0236 * update screen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
278 lda ,x+ * Get again
1e312b144f4d Major changes:
boisy
parents:
diff changeset
279 anda #$0F * mask out odd line
1e312b144f4d Major changes:
boisy
parents:
diff changeset
280 bsr L0227 * update screen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
281 dec ,s * Decrement character data byte counter
1e312b144f4d Major changes:
boisy
parents:
diff changeset
282 bne L0211 * all done ?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
283 dec V.51CursorChanged,u * Flag character update finished
1e312b144f4d Major changes:
boisy
parents:
diff changeset
284 clrb * flag no error
1e312b144f4d Major changes:
boisy
parents:
diff changeset
285 puls pc,b * return to caller
1e312b144f4d Major changes:
boisy
parents:
diff changeset
286
1e312b144f4d Major changes:
boisy
parents:
diff changeset
287
1e312b144f4d Major changes:
boisy
parents:
diff changeset
288 L0227 ldb V.51BytePixOffset,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
289 subb #$04
1e312b144f4d Major changes:
boisy
parents:
diff changeset
290 bhi L023B
1e312b144f4d Major changes:
boisy
parents:
diff changeset
291 beq L0250
1e312b144f4d Major changes:
boisy
parents:
diff changeset
292 L0230 lsla
1e312b144f4d Major changes:
boisy
parents:
diff changeset
293 incb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
294 bne L0230
1e312b144f4d Major changes:
boisy
parents:
diff changeset
295 bra L0250
1e312b144f4d Major changes:
boisy
parents:
diff changeset
296
1e312b144f4d Major changes:
boisy
parents:
diff changeset
297 L0236 ldb V.51BytePixOffset,u * Retrieve byte pixel offset
1e312b144f4d Major changes:
boisy
parents:
diff changeset
298 beq L0250
1e312b144f4d Major changes:
boisy
parents:
diff changeset
299
1e312b144f4d Major changes:
boisy
parents:
diff changeset
300 L023B lsra * manipulate character data into correct position
1e312b144f4d Major changes:
boisy
parents:
diff changeset
301 decb * in a similar way to the mask above
1e312b144f4d Major changes:
boisy
parents:
diff changeset
302 bhi L023B
1e312b144f4d Major changes:
boisy
parents:
diff changeset
303 bne L0244
1e312b144f4d Major changes:
boisy
parents:
diff changeset
304 rorb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
305 bra L0250
1e312b144f4d Major changes:
boisy
parents:
diff changeset
306 L0244 pshs b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
307 ldb #$80
1e312b144f4d Major changes:
boisy
parents:
diff changeset
308 L0248 lsra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
309 rorb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
310 dec ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
311 bne L0248
1e312b144f4d Major changes:
boisy
parents:
diff changeset
312 leas $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
313
1e312b144f4d Major changes:
boisy
parents:
diff changeset
314 L0250 tst V.51XORFlag,u * are we XORing data direct to screen ?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
315 bne L0273 * Yes : just do it
1e312b144f4d Major changes:
boisy
parents:
diff changeset
316 tst V.51ReverseFlag,u * are we in reverse mode ?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
317 beq L0262 * no : just output data
1e312b144f4d Major changes:
boisy
parents:
diff changeset
318 coma * set mask up for reverse mode
1e312b144f4d Major changes:
boisy
parents:
diff changeset
319 comb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
320 eora V.51ScreenMask1,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
321 eorb V.51ScreenMask2,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
322
1e312b144f4d Major changes:
boisy
parents:
diff changeset
323 L0262 pshs b,a * combine mask and screen data
1e312b144f4d Major changes:
boisy
parents:
diff changeset
324 ldd V.51ScreenMask1,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
325 anda ,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
326 andb $01,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
327 addd ,s++
1e312b144f4d Major changes:
boisy
parents:
diff changeset
328
1e312b144f4d Major changes:
boisy
parents:
diff changeset
329 L026D std ,y * screen update
1e312b144f4d Major changes:
boisy
parents:
diff changeset
330 leay <$20,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
331 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
332
1e312b144f4d Major changes:
boisy
parents:
diff changeset
333 L0273 eora ,y * XOR onto screen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
334 eorb $01,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
335 bra L026D
1e312b144f4d Major changes:
boisy
parents:
diff changeset
336
1e312b144f4d Major changes:
boisy
parents:
diff changeset
337 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
338 * $07 - BEL (ding!)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
339 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
340
1e312b144f4d Major changes:
boisy
parents:
diff changeset
341 DoBell
1e312b144f4d Major changes:
boisy
parents:
diff changeset
342 ldx #$FF20
1e312b144f4d Major changes:
boisy
parents:
diff changeset
343 ldb #$64
1e312b144f4d Major changes:
boisy
parents:
diff changeset
344 L027E lda ,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
345 eora #$C0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
346 sta ,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
347 lda #$19
1e312b144f4d Major changes:
boisy
parents:
diff changeset
348 L0286 deca
1e312b144f4d Major changes:
boisy
parents:
diff changeset
349 nop
1e312b144f4d Major changes:
boisy
parents:
diff changeset
350 nop
1e312b144f4d Major changes:
boisy
parents:
diff changeset
351 bne L0286
1e312b144f4d Major changes:
boisy
parents:
diff changeset
352 decb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
353 bne L027E
1e312b144f4d Major changes:
boisy
parents:
diff changeset
354 lbra CancelEscSequence
1e312b144f4d Major changes:
boisy
parents:
diff changeset
355 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
356 * $08 - BS (left arrow)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
357 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
358 DoBackspace
1e312b144f4d Major changes:
boisy
parents:
diff changeset
359 lbsr DoEraseCursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
360 dec V.51XPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
361 bpl DoBSUpdateCursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
362 lda #$32
1e312b144f4d Major changes:
boisy
parents:
diff changeset
363 sta V.51XPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
364 bra DoCursorUp1
1e312b144f4d Major changes:
boisy
parents:
diff changeset
365 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
366 * $1b44 - (cursor up)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
367 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
368 DoCursorUp
1e312b144f4d Major changes:
boisy
parents:
diff changeset
369 lbsr DoEraseCursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
370 DoCursorUp1
1e312b144f4d Major changes:
boisy
parents:
diff changeset
371 dec V.51YPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
372 bpl L02A6
1e312b144f4d Major changes:
boisy
parents:
diff changeset
373 clr V.51YPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
374 lbsr L035E
1e312b144f4d Major changes:
boisy
parents:
diff changeset
375 L02A6 lbsr L0484
1e312b144f4d Major changes:
boisy
parents:
diff changeset
376 lbra CancelEscSequence
1e312b144f4d Major changes:
boisy
parents:
diff changeset
377
1e312b144f4d Major changes:
boisy
parents:
diff changeset
378 DoBSUpdateCursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
379 lbsr L0484
1e312b144f4d Major changes:
boisy
parents:
diff changeset
380 lbsr DoDisplayCursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
381 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
382
1e312b144f4d Major changes:
boisy
parents:
diff changeset
383 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
384 * $0a, $1b45 - LF, (cursor down)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
385 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
386
1e312b144f4d Major changes:
boisy
parents:
diff changeset
387 DoLineFeed
1e312b144f4d Major changes:
boisy
parents:
diff changeset
388 lbsr DoEraseCursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
389 lda V.51YPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
390 inca
1e312b144f4d Major changes:
boisy
parents:
diff changeset
391 cmpa #$18
1e312b144f4d Major changes:
boisy
parents:
diff changeset
392 bcs L02B9
1e312b144f4d Major changes:
boisy
parents:
diff changeset
393 lbsr SoScrollScreen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
394 bra L02BC
1e312b144f4d Major changes:
boisy
parents:
diff changeset
395 L02B9 sta V.51YPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
396 L02BC lbsr DoDisplayCursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
397 bra L02A6
1e312b144f4d Major changes:
boisy
parents:
diff changeset
398
1e312b144f4d Major changes:
boisy
parents:
diff changeset
399 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
400 * $0d - CR (return)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
401 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
402
1e312b144f4d Major changes:
boisy
parents:
diff changeset
403 DoCarrageReturn
1e312b144f4d Major changes:
boisy
parents:
diff changeset
404 lbsr DoEraseCursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
405 clr V.51XPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
406 bra L02A6
1e312b144f4d Major changes:
boisy
parents:
diff changeset
407
1e312b144f4d Major changes:
boisy
parents:
diff changeset
408 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
409 * $0c - FF (clear screen)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
410 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
411 DoCLS
1e312b144f4d Major changes:
boisy
parents:
diff changeset
412 ldy V.51ScrnA,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
413 leay >$0080,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
414 lda #$18
1e312b144f4d Major changes:
boisy
parents:
diff changeset
415 pshs a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
416 inc V.51CursorChanged,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
417 L02D2 bsr L0314
1e312b144f4d Major changes:
boisy
parents:
diff changeset
418 dec ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
419 bne L02D2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
420 leas $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
421 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
422 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
423 std V.51OldCursorPosX,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
424 std V.51XPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
425 dec V.51CursorChanged,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
426 ldx #$FF20
1e312b144f4d Major changes:
boisy
parents:
diff changeset
427 lda $02,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
428 ora #$F0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
429 sta $02,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
430 ldx #$FFC0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
431 lda #$06
1e312b144f4d Major changes:
boisy
parents:
diff changeset
432 ldb #$03
1e312b144f4d Major changes:
boisy
parents:
diff changeset
433 bsr L0305
1e312b144f4d Major changes:
boisy
parents:
diff changeset
434 lda V.51ScrnA,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
435 lsra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
436 ldb #$07
1e312b144f4d Major changes:
boisy
parents:
diff changeset
437 bsr L0305
1e312b144f4d Major changes:
boisy
parents:
diff changeset
438 clr V.51CursorOn,u * Flag cursor is off
1e312b144f4d Major changes:
boisy
parents:
diff changeset
439 lbsr DoDisplayCursor * Display cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
440 lbra CancelEscSequence
1e312b144f4d Major changes:
boisy
parents:
diff changeset
441
1e312b144f4d Major changes:
boisy
parents:
diff changeset
442 L0305 lsra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
443 bcc L030E
1e312b144f4d Major changes:
boisy
parents:
diff changeset
444 leax $01,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
445 sta ,x+
1e312b144f4d Major changes:
boisy
parents:
diff changeset
446 bra L0310
1e312b144f4d Major changes:
boisy
parents:
diff changeset
447 L030E sta ,x++
1e312b144f4d Major changes:
boisy
parents:
diff changeset
448 L0310 decb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
449 bne L0305
1e312b144f4d Major changes:
boisy
parents:
diff changeset
450 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
451
1e312b144f4d Major changes:
boisy
parents:
diff changeset
452 L0314 lda #$10
1e312b144f4d Major changes:
boisy
parents:
diff changeset
453 L0316 pshs a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
454 lda V.51ReverseFlag,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
455 tfr a,b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
456 L031D std <-$80,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
457 std <-$60,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
458 std <-$40,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
459 std <-$20,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
460 std <$20,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
461 std <$40,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
462 std <$60,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
463 std ,y++
1e312b144f4d Major changes:
boisy
parents:
diff changeset
464 dec ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
465 bne L031D
1e312b144f4d Major changes:
boisy
parents:
diff changeset
466 leay >$00E0,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
467 puls pc,b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
468
1e312b144f4d Major changes:
boisy
parents:
diff changeset
469 SoScrollScreen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
470 ldy V.51ScrnA,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
471 inc V.51CursorChanged,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
472 pshs u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
473 leau >$0100,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
474 lda #$10
1e312b144f4d Major changes:
boisy
parents:
diff changeset
475 bsr L037C
1e312b144f4d Major changes:
boisy
parents:
diff changeset
476 puls u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
477 dec V.51OldCursorPosY,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
478
1e312b144f4d Major changes:
boisy
parents:
diff changeset
479 L0354 leay >$0080,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
480 bsr L0314
1e312b144f4d Major changes:
boisy
parents:
diff changeset
481 dec V.51CursorChanged,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
482 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
483
1e312b144f4d Major changes:
boisy
parents:
diff changeset
484 L035E ldy V.51ScrnA,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
485 leay >$17F0,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
486 inc V.51CursorChanged,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
487 pshs u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
488 leau >-$0100,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
489 lda #$F0
1e312b144f4d Major changes:
boisy
parents:
diff changeset
490 bsr L037C
1e312b144f4d Major changes:
boisy
parents:
diff changeset
491 leay ,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
492 puls u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
493 inc V.51OldCursorPosY,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
494 bra L0354
1e312b144f4d Major changes:
boisy
parents:
diff changeset
495
1e312b144f4d Major changes:
boisy
parents:
diff changeset
496 L037C ldb #$17
1e312b144f4d Major changes:
boisy
parents:
diff changeset
497 pshs b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
498 L0380 ldb #$10
1e312b144f4d Major changes:
boisy
parents:
diff changeset
499
1e312b144f4d Major changes:
boisy
parents:
diff changeset
500 L0382 ldx ,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
501 stx ,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
502 ldx $02,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
503 stx $02,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
504 ldx $04,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
505 stx $04,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
506 ldx $06,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
507 stx $06,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
508 ldx $08,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
509 stx $08,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
510 ldx $0A,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
511 stx $0A,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
512 ldx $0C,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
513 stx $0C,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
514 ldx $0E,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
515 stx $0E,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
516 leay a,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
517 leau a,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
518 decb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
519 bne L0382
1e312b144f4d Major changes:
boisy
parents:
diff changeset
520 dec ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
521 bne L0380
1e312b144f4d Major changes:
boisy
parents:
diff changeset
522 puls pc,b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
523
1e312b144f4d Major changes:
boisy
parents:
diff changeset
524 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
525 * $1b42 - clear to end of line
1e312b144f4d Major changes:
boisy
parents:
diff changeset
526 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
527
1e312b144f4d Major changes:
boisy
parents:
diff changeset
528 DoClrEOL
1e312b144f4d Major changes:
boisy
parents:
diff changeset
529 inc V.51CursorChanged,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
530 bsr L03BA
1e312b144f4d Major changes:
boisy
parents:
diff changeset
531 dec V.51CursorChanged,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
532 lbra CancelEscSequence
1e312b144f4d Major changes:
boisy
parents:
diff changeset
533 L03BA
1e312b144f4d Major changes:
boisy
parents:
diff changeset
534 ldb V.51XPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
535 pshs b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
536 bitb #$07
1e312b144f4d Major changes:
boisy
parents:
diff changeset
537 bne L03CB
1e312b144f4d Major changes:
boisy
parents:
diff changeset
538 lda #$05
1e312b144f4d Major changes:
boisy
parents:
diff changeset
539 mul
1e312b144f4d Major changes:
boisy
parents:
diff changeset
540 bra L03F3
1e312b144f4d Major changes:
boisy
parents:
diff changeset
541 L03CB lda #$01
1e312b144f4d Major changes:
boisy
parents:
diff changeset
542 pshs a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
543 L03CF lda #$20
1e312b144f4d Major changes:
boisy
parents:
diff changeset
544 lbsr DrawCharacter
1e312b144f4d Major changes:
boisy
parents:
diff changeset
545 lda V.51XPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
546 inca
1e312b144f4d Major changes:
boisy
parents:
diff changeset
547 sta V.51XPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
548 cmpa #$33
1e312b144f4d Major changes:
boisy
parents:
diff changeset
549 bcs L03E3
1e312b144f4d Major changes:
boisy
parents:
diff changeset
550 leas $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
551 bra L040D
1e312b144f4d Major changes:
boisy
parents:
diff changeset
552 L03E3 dec ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
553 bpl L03CF
1e312b144f4d Major changes:
boisy
parents:
diff changeset
554 lda V.51XPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
555 ldb #$05
1e312b144f4d Major changes:
boisy
parents:
diff changeset
556 mul
1e312b144f4d Major changes:
boisy
parents:
diff changeset
557 bitb #$08
1e312b144f4d Major changes:
boisy
parents:
diff changeset
558 bne L03CF
1e312b144f4d Major changes:
boisy
parents:
diff changeset
559 leas $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
560 L03F3 lsrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
561 lsrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
562 lsrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
563 ldy V.51ScrnA,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
564 lda V.51YPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
565 leay d,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
566 leay >$0080,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
567 lda #$20
1e312b144f4d Major changes:
boisy
parents:
diff changeset
568 pshs b
1e312b144f4d Major changes:
boisy
parents:
diff changeset
569 suba ,s+
1e312b144f4d Major changes:
boisy
parents:
diff changeset
570 lsra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
571 lbsr L0316
1e312b144f4d Major changes:
boisy
parents:
diff changeset
572 L040D puls a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
573 sta V.51XPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
574 lbsr DoDisplayCursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
575 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
576 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
577 * $1b4A - clear to end of screen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
578 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
579 DoClearEOS
1e312b144f4d Major changes:
boisy
parents:
diff changeset
580 inc V.51CursorChanged,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
581 bsr L03BA
1e312b144f4d Major changes:
boisy
parents:
diff changeset
582 lda #$17
1e312b144f4d Major changes:
boisy
parents:
diff changeset
583 suba V.51YPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
584 bls L042A
1e312b144f4d Major changes:
boisy
parents:
diff changeset
585 pshs a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
586 L0421 lbsr L0314
1e312b144f4d Major changes:
boisy
parents:
diff changeset
587 dec ,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
588 bne L0421
1e312b144f4d Major changes:
boisy
parents:
diff changeset
589 leas $01,s
1e312b144f4d Major changes:
boisy
parents:
diff changeset
590 L042A dec V.51CursorChanged,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
591 lbsr DoDisplayCursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
592 lbra CancelEscSequence
1e312b144f4d Major changes:
boisy
parents:
diff changeset
593
1e312b144f4d Major changes:
boisy
parents:
diff changeset
594 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
595 *$0b - (cursor home)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
596 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
597 DoHome
1e312b144f4d Major changes:
boisy
parents:
diff changeset
598 lbsr DoEraseCursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
599 clr V.51XPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
600 clr V.51YPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
601 lbsr DoDisplayCursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
602 lbra L02A6
1e312b144f4d Major changes:
boisy
parents:
diff changeset
603
1e312b144f4d Major changes:
boisy
parents:
diff changeset
604 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
605 * $1b41xxyy - move cursor to col xx (0-50) row yy (0-23)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
606 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
607 DoGotoXY
1e312b144f4d Major changes:
boisy
parents:
diff changeset
608 lbsr DoEraseCursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
609 ldb V.51EscSeq,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
610 subb #$02
1e312b144f4d Major changes:
boisy
parents:
diff changeset
611 bne L0442
1e312b144f4d Major changes:
boisy
parents:
diff changeset
612 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
613 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
614 L0442 decb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
615 bne L0450
1e312b144f4d Major changes:
boisy
parents:
diff changeset
616 cmpa #51
1e312b144f4d Major changes:
boisy
parents:
diff changeset
617 bcs L044B
1e312b144f4d Major changes:
boisy
parents:
diff changeset
618 lda #50
1e312b144f4d Major changes:
boisy
parents:
diff changeset
619 L044B sta V.51XPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
620 L044D clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
621 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
622 L0450 cmpa #24
1e312b144f4d Major changes:
boisy
parents:
diff changeset
623 bcs L0456
1e312b144f4d Major changes:
boisy
parents:
diff changeset
624 lda #23
1e312b144f4d Major changes:
boisy
parents:
diff changeset
625 L0456 sta V.51YPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
626 L0459 lbsr DoDisplayCursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
627 lbra L02A6
1e312b144f4d Major changes:
boisy
parents:
diff changeset
628
1e312b144f4d Major changes:
boisy
parents:
diff changeset
629 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
630 * $1b43 - (cursor right)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
631 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
632 DoCursorRight
1e312b144f4d Major changes:
boisy
parents:
diff changeset
633 lbsr DoEraseCursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
634 inc V.51XPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
635 lda V.51XPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
636 cmpa #$33
1e312b144f4d Major changes:
boisy
parents:
diff changeset
637 bcs L0459
1e312b144f4d Major changes:
boisy
parents:
diff changeset
638 clr V.51XPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
639 lbra DoLineFeed
1e312b144f4d Major changes:
boisy
parents:
diff changeset
640 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
641 * $1b46 - reverse on
1e312b144f4d Major changes:
boisy
parents:
diff changeset
642 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
643 DoReverseOn
1e312b144f4d Major changes:
boisy
parents:
diff changeset
644 lda #$FF
1e312b144f4d Major changes:
boisy
parents:
diff changeset
645 coma
1e312b144f4d Major changes:
boisy
parents:
diff changeset
646 L046F sta V.51ReverseFlag,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
647 lbra CancelEscSequence
1e312b144f4d Major changes:
boisy
parents:
diff changeset
648
1e312b144f4d Major changes:
boisy
parents:
diff changeset
649 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
650 * $1b47 - reverse off
1e312b144f4d Major changes:
boisy
parents:
diff changeset
651 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
652 DoReverseOff
1e312b144f4d Major changes:
boisy
parents:
diff changeset
653 lda #$FF
1e312b144f4d Major changes:
boisy
parents:
diff changeset
654 bra L046F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
655
1e312b144f4d Major changes:
boisy
parents:
diff changeset
656 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
657 * $1b48 - underline on
1e312b144f4d Major changes:
boisy
parents:
diff changeset
658 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
659 DoUnderlineOn
1e312b144f4d Major changes:
boisy
parents:
diff changeset
660 lda #$FF
1e312b144f4d Major changes:
boisy
parents:
diff changeset
661 L047B sta V.51UnderlineFlag,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
662 lbra CancelEscSequence
1e312b144f4d Major changes:
boisy
parents:
diff changeset
663
1e312b144f4d Major changes:
boisy
parents:
diff changeset
664 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
665 * $1b49 - underline off
1e312b144f4d Major changes:
boisy
parents:
diff changeset
666 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
667 DoUnderlineOff
1e312b144f4d Major changes:
boisy
parents:
diff changeset
668 clra
1e312b144f4d Major changes:
boisy
parents:
diff changeset
669 bra L047B
1e312b144f4d Major changes:
boisy
parents:
diff changeset
670
1e312b144f4d Major changes:
boisy
parents:
diff changeset
671
1e312b144f4d Major changes:
boisy
parents:
diff changeset
672 L0484 ldd V.51XPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
673 inc V.51CursorChanged,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
674 std V.51OldCursorPosX,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
675 bra L04B9
1e312b144f4d Major changes:
boisy
parents:
diff changeset
676
1e312b144f4d Major changes:
boisy
parents:
diff changeset
677 L0494 pshs b,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
678 ldd V.51OldCursorPosX,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
679 inc V.51XORFlag,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
680 tstb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
681 bmi L04AB
1e312b144f4d Major changes:
boisy
parents:
diff changeset
682 cmpb #$18
1e312b144f4d Major changes:
boisy
parents:
diff changeset
683 bcc L04AB
1e312b144f4d Major changes:
boisy
parents:
diff changeset
684 std V.51XPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
685 lda #$7F
1e312b144f4d Major changes:
boisy
parents:
diff changeset
686 lbsr DrawCharacter
1e312b144f4d Major changes:
boisy
parents:
diff changeset
687
1e312b144f4d Major changes:
boisy
parents:
diff changeset
688 L04AB puls b,a
1e312b144f4d Major changes:
boisy
parents:
diff changeset
689 std V.51XPos,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
690 std V.51OldCursorPosX,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
691 dec V.51XORFlag,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
692 L04B9 dec V.51CursorChanged,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
693 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
694 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
695
1e312b144f4d Major changes:
boisy
parents:
diff changeset
696 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
697 * Display and Erase cursor routines, work by xoring cursor character onto the
1e312b144f4d Major changes:
boisy
parents:
diff changeset
698 * screen, the variable V.51CursorOn, is implemented such that it prevents
1e312b144f4d Major changes:
boisy
parents:
diff changeset
699 * multiple calls to these routines from acting as an inverse, so that they
1e312b144f4d Major changes:
boisy
parents:
diff changeset
700 * may be called from any code, irispective of if the cursor is already on/off.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
701 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
702
1e312b144f4d Major changes:
boisy
parents:
diff changeset
703 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
704 * Display Cursor.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
705 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
706 DoDisplayCursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
707 inc V.NoFlash,u * Flag in flash
1e312b144f4d Major changes:
boisy
parents:
diff changeset
708 tst V.51CursorOn,u * Get cursor on flag
1e312b144f4d Major changes:
boisy
parents:
diff changeset
709 bne DoCursorOnEnd * Yes : don't re-display
1e312b144f4d Major changes:
boisy
parents:
diff changeset
710 bsr DoCursorCommon * Display cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
711 inc V.51CursorOn,u * Flag cursor on
1e312b144f4d Major changes:
boisy
parents:
diff changeset
712 DoCursorOnEnd
1e312b144f4d Major changes:
boisy
parents:
diff changeset
713 dec V.NoFlash,u * Flag flash done
1e312b144f4d Major changes:
boisy
parents:
diff changeset
714 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
715 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
716 * Erase cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
717 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
718 DoEraseCursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
719 inc V.NoFlash,u * Flag in Flash
1e312b144f4d Major changes:
boisy
parents:
diff changeset
720 tst V.51Cursoron,u * Get cursor on flag
1e312b144f4d Major changes:
boisy
parents:
diff changeset
721 beq DoEraseCursorEnd * no : don't atempt to turn off
1e312b144f4d Major changes:
boisy
parents:
diff changeset
722 bsr DoCursorCommon * Hide cursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
723 clr V.51CursorOn,u * Flag cursor off
1e312b144f4d Major changes:
boisy
parents:
diff changeset
724 DoEraseCursorEnd
1e312b144f4d Major changes:
boisy
parents:
diff changeset
725 dec V.NoFlash,u * Flag Flash done
1e312b144f4d Major changes:
boisy
parents:
diff changeset
726 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
727
1e312b144f4d Major changes:
boisy
parents:
diff changeset
728 DoCursorCommon
1e312b144f4d Major changes:
boisy
parents:
diff changeset
729 lda #$7f * Cursor character $7f = block
1e312b144f4d Major changes:
boisy
parents:
diff changeset
730 inc V.51XORFlag,u * Flag xor on screen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
731 lbsr DrawCharacter * Draw it
1e312b144f4d Major changes:
boisy
parents:
diff changeset
732 dec V.51XORFlag,u * Flag no xor on screen
1e312b144f4d Major changes:
boisy
parents:
diff changeset
733 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
734
1e312b144f4d Major changes:
boisy
parents:
diff changeset
735 L04CA clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
736 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
737 GetStat
1e312b144f4d Major changes:
boisy
parents:
diff changeset
738 cmpa #$06
1e312b144f4d Major changes:
boisy
parents:
diff changeset
739 beq L04CA
1e312b144f4d Major changes:
boisy
parents:
diff changeset
740 cmpa #$02
1e312b144f4d Major changes:
boisy
parents:
diff changeset
741 bne SetStat
1e312b144f4d Major changes:
boisy
parents:
diff changeset
742 ldx $06,y
1e312b144f4d Major changes:
boisy
parents:
diff changeset
743 ldd V.51ScrnA,u
1e312b144f4d Major changes:
boisy
parents:
diff changeset
744 std $04,x
1e312b144f4d Major changes:
boisy
parents:
diff changeset
745 clrb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
746 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
747
1e312b144f4d Major changes:
boisy
parents:
diff changeset
748 SetStat comb
1e312b144f4d Major changes:
boisy
parents:
diff changeset
749 ldb #E$UnkSvc
1e312b144f4d Major changes:
boisy
parents:
diff changeset
750 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
751
1e312b144f4d Major changes:
boisy
parents:
diff changeset
752 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
753 * Flash cursor, called by IRQ routine from VTIO
1e312b144f4d Major changes:
boisy
parents:
diff changeset
754 *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
755
1e312b144f4d Major changes:
boisy
parents:
diff changeset
756 FlashCursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
757 tst V.NoFlash,u * Should we flash ?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
758 bne FlashExit * No: just return
1e312b144f4d Major changes:
boisy
parents:
diff changeset
759 tst V.51CursorOn,u * Is cursor on ?
1e312b144f4d Major changes:
boisy
parents:
diff changeset
760 bne FlashOff * Yep : turn off
1e312b144f4d Major changes:
boisy
parents:
diff changeset
761 bra DoDisplayCursor * Else turn it on
1e312b144f4d Major changes:
boisy
parents:
diff changeset
762 FlashOff
1e312b144f4d Major changes:
boisy
parents:
diff changeset
763 bra DoEraseCursor
1e312b144f4d Major changes:
boisy
parents:
diff changeset
764 FlashExit
1e312b144f4d Major changes:
boisy
parents:
diff changeset
765 rts
1e312b144f4d Major changes:
boisy
parents:
diff changeset
766
1e312b144f4d Major changes:
boisy
parents:
diff changeset
767
1e312b144f4d Major changes:
boisy
parents:
diff changeset
768 * control characters dispatch table
1e312b144f4d Major changes:
boisy
parents:
diff changeset
769 CtrlCharDispatch
1e312b144f4d Major changes:
boisy
parents:
diff changeset
770 fcb $07 BEL * (beep)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
771 fdb DoBell-CtrlCharDispatch $FC0B
1e312b144f4d Major changes:
boisy
parents:
diff changeset
772 fcb $08 BS * (left arrow)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
773 fdb DoBackspace-CtrlCharDispatch * $FC23
1e312b144f4d Major changes:
boisy
parents:
diff changeset
774 fcb $0A LF * (down arrow)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
775 fdb DoLineFeed-CtrlCharDispatch * $FC3E
1e312b144f4d Major changes:
boisy
parents:
diff changeset
776 fcb $0D CR * (return)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
777 fdb DoCarrageReturn-CtrlCharDispatch *$FC50
1e312b144f4d Major changes:
boisy
parents:
diff changeset
778 fcb $0C FF * (clear screen)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
779 fdb DoCLS-CtrlCharDispatch $FC55
1e312b144f4d Major changes:
boisy
parents:
diff changeset
780 fcb $0B * (cursor home)
1e312b144f4d Major changes:
boisy
parents:
diff changeset
781 fdb DoHome-CtrlCharDispatch $FDC2
1e312b144f4d Major changes:
boisy
parents:
diff changeset
782 fcb $00
1e312b144f4d Major changes:
boisy
parents:
diff changeset
783
1e312b144f4d Major changes:
boisy
parents:
diff changeset
784 * escape sequences dispatch table
1e312b144f4d Major changes:
boisy
parents:
diff changeset
785 EscCharDispatch
1e312b144f4d Major changes:
boisy
parents:
diff changeset
786 fcb $41 * cursor xy
1e312b144f4d Major changes:
boisy
parents:
diff changeset
787 fdb DoGotoXY-CtrlCharDispatch * $FDCB
1e312b144f4d Major changes:
boisy
parents:
diff changeset
788 fcb $42 * clear EOL
1e312b144f4d Major changes:
boisy
parents:
diff changeset
789 fdb DoClrEOL-CtrlCharDispatch * $FD41
1e312b144f4d Major changes:
boisy
parents:
diff changeset
790 fcb $43 * cursor right
1e312b144f4d Major changes:
boisy
parents:
diff changeset
791 fdb DoCursorRight-CtrlCharDispatch * $FDEE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
792 fcb $44 * cursor up
1e312b144f4d Major changes:
boisy
parents:
diff changeset
793 fdb DoCursorUp-CtrlCharDispatch * $FC2D
1e312b144f4d Major changes:
boisy
parents:
diff changeset
794 fcb $45 * cursor down
1e312b144f4d Major changes:
boisy
parents:
diff changeset
795 fdb DoLineFeed-CtrlCharDispatch * $FC3E
1e312b144f4d Major changes:
boisy
parents:
diff changeset
796 fcb $46 * reverse on
1e312b144f4d Major changes:
boisy
parents:
diff changeset
797 fdb DoReverseOn-CtrlCharDispatch * $FDFE
1e312b144f4d Major changes:
boisy
parents:
diff changeset
798 fcb $47 * reverse off
1e312b144f4d Major changes:
boisy
parents:
diff changeset
799 fdb DoReverseOff-CtrlCharDispatch * $FE07
1e312b144f4d Major changes:
boisy
parents:
diff changeset
800 fcb $48 * underline on
1e312b144f4d Major changes:
boisy
parents:
diff changeset
801 fdb DoUnderlineOn-CtrlCharDispatch * $FE0B
1e312b144f4d Major changes:
boisy
parents:
diff changeset
802 fcb $49 * underline off
1e312b144f4d Major changes:
boisy
parents:
diff changeset
803 fdb DoUnderlineOff-CtrlCharDispatch * $FE13
1e312b144f4d Major changes:
boisy
parents:
diff changeset
804 fcb $4A * clear EOS
1e312b144f4d Major changes:
boisy
parents:
diff changeset
805 fdb DoClearEOS-CtrlCharDispatch * $FDA5
1e312b144f4d Major changes:
boisy
parents:
diff changeset
806 fcb $00
1e312b144f4d Major changes:
boisy
parents:
diff changeset
807
1e312b144f4d Major changes:
boisy
parents:
diff changeset
808 CharacterShapes
1e312b144f4d Major changes:
boisy
parents:
diff changeset
809 * 4x8 bitmap table for characters $20-$7f
1e312b144f4d Major changes:
boisy
parents:
diff changeset
810 * each nibble represents a row of 4 dots
1e312b144f4d Major changes:
boisy
parents:
diff changeset
811 * chars 20-27
1e312b144f4d Major changes:
boisy
parents:
diff changeset
812 fcb $00,$00,$00,$00 .... .@.. .@.@ .@@. ..@. @..@ .@.. .@..
1e312b144f4d Major changes:
boisy
parents:
diff changeset
813 fcb $44,$40,$40,$00 .... .@.. .@.@ @@@@ .@@@ ...@ @.@. .@..
1e312b144f4d Major changes:
boisy
parents:
diff changeset
814 fcb $55,$00,$00,$00 .... .@.. .... .@@. @... ..@. .@.. ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
815 fcb $6F,$6F,$60,$00 .... .... .... @@@@ .@@. .@.. @.@. ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
816 fcb $27,$86,$1E,$20 .... .@.. .... .@@. ...@ @... @@.@ ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
817 fcb $91,$24,$89,$00 .... .... .... .... @@@. @..@ .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
818 fcb $4A,$4A,$D0,$00 .... .... .... .... ..@. .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
819 fcb $44,$00,$00,$00 .... .... .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
820 * chars 29-2f
1e312b144f4d Major changes:
boisy
parents:
diff changeset
821 fcb $24,$44,$20,$00 ..@. .@.. @..@ .@.. .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
822 fcb $42,$22,$40,$00 .@.. ..@. .@@. .@.. .... .... .... ...@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
823 fcb $96,$F6,$90,$00 .@.. ..@. @@@@ @@@. .... @@@@ .... ..@.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
824 fcb $44,$E4,$40,$00 .@.. ..@. .@@. .@.. ..@. .... .@@. .@..
1e312b144f4d Major changes:
boisy
parents:
diff changeset
825 fcb $00,$02,$24,$00 ..@. .@.. @..@ .@.. ..@. .... .@@. @...
1e312b144f4d Major changes:
boisy
parents:
diff changeset
826 fcb $00,$F0,$00,$00 .... .... .... .... .@.. .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
827 fcb $00,$06,$60,$00 .... .... .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
828 fcb $01,$24,$80,$00 .... .... .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
829 * chars 30-37
1e312b144f4d Major changes:
boisy
parents:
diff changeset
830 fcb $69,$BD,$60,$00 .@@. ..@. .@@. @@@. ..@. @@@@ .@@@ @@@@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
831 fcb $26,$22,$70,$00 @..@ .@@. @..@ ...@ .@@. @... @... ...@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
832 fcb $69,$2C,$F0,$00 @.@@ ..@. ..@. .@@. @.@. @@@. @@@. ..@.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
833 fcb $E1,$61,$E0,$00 @@.@ ..@. @@.. ...@ @@@@ ...@ @..@ .@..
1e312b144f4d Major changes:
boisy
parents:
diff changeset
834 fcb $26,$AF,$20,$00 .@@. .@@@ @@@@ @@@. ..@. @@@. .@@. .@..
1e312b144f4d Major changes:
boisy
parents:
diff changeset
835 fcb $F8,$E1,$E0,$00 .... .... .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
836 fcb $78,$E9,$60,$00 .... .... .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
837 fcb $F1,$24,$40,$00 .... .... .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
838 * chars 38-3f
1e312b144f4d Major changes:
boisy
parents:
diff changeset
839 fcb $69,$69,$60,$00 .@@. .@@. .... .... ..@. .... .@.. .@@.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
840 fcb $69,$71,$60,$00 @..@ @..@ .... .... .@.. @@@@ ..@. @..@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
841 fcb $00,$40,$40,$00 .@@. .@@@ .@.. ..@. @... .... ...@ ..@.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
842 fcb $00,$20,$24,$00 @..@ ...@ .... .... .@.. @@@@ ..@. ..@.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
843 fcb $24,$84,$20,$00 .@@. .@@. .@.. ..@. ..@. .... .@.. ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
844 fcb $0F,$0F,$00,$00 .... .... .... .@.. .... .... .... ..@.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
845 fcb $42,$12,$40,$00 .... .... .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
846 fcb $69,$22,$02,$00 .... .... .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
847 * chars 40-47
1e312b144f4d Major changes:
boisy
parents:
diff changeset
848 fcb $69,$BB,$87,$00 .@@. .@@. @@@. .@@@ @@@. @@@@ @@@@ .@@@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
849 fcb $69,$F9,$90,$00 @..@ @..@ @..@ @... @..@ @... @... @...
1e312b144f4d Major changes:
boisy
parents:
diff changeset
850 fcb $E9,$E9,$E0,$00 @.@@ @@@@ @@@. @... @..@ @@@. @@@. @.@@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
851 fcb $78,$88,$70,$00 @.@@ @..@ @..@ @... @..@ @... @... @..@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
852 fcb $E9,$99,$E0,$00 @... @..@ @@@. .@@@ @@@. @@@@ @... .@@@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
853 fcb $F8,$E8,$F0,$00 .@@@ .... .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
854 fcb $F8,$E8,$80,$00 .... .... .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
855 fcb $78,$B9,$70,$00 .... .... .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
856 * chars 48-4f
1e312b144f4d Major changes:
boisy
parents:
diff changeset
857 fcb $99,$F9,$90,$00 @..@ @@@. @@@@ @..@ @... @@@@ @..@ .@@.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
858 fcb $E4,$44,$E0,$00 @..@ .@.. ..@. @.@. @... @@.@ @@.@ @..@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
859 fcb $F2,$2A,$40,$00 @@@@ .@.. ..@. @@.. @... @@.@ @.@@ @..@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
860 fcb $9A,$CA,$90,$00 @..@ .@.. @.@. @.@. @... @..@ @..@ @..@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
861 fcb $88,$88,$F0,$00 @..@ @@@. .@.. @..@ @@@@ @..@ @..@ .@@.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
862 fcb $FD,$D9,$90,$00 .... .... .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
863 fcb $9D,$B9,$90,$00 .... .... .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
864 fcb $69,$99,$60,$00 .... .... .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
865 * chars 50-57
1e312b144f4d Major changes:
boisy
parents:
diff changeset
866 fcb $E9,$E8,$80,$00 @@@. .@@. @@@. .@@@ @@@. @..@ @..@ @..@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
867 fcb $69,$9B,$70,$00 @..@ @..@ @..@ @... .@.. @..@ @..@ @..@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
868 fcb $E9,$EA,$90,$00 @@@. @..@ @@@. .@@. .@.. @..@ @..@ @@.@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
869 fcb $78,$61,$E0,$00 @... @.@@ @.@. ...@ .@.. @..@ .@@. @@.@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
870 fcb $E4,$44,$40,$00 @... .@@@ @..@ @@@. .@.. .@@. .@@. @@@@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
871 fcb $99,$99,$60,$00 .... .... .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
872 fcb $99,$96,$60,$00 .... .... .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
873 fcb $99,$DD,$F0,$00 .... .... .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
874 * chars 58-5f
1e312b144f4d Major changes:
boisy
parents:
diff changeset
875 fcb $99,$69,$90,$00 @..@ @..@ @@@@ @@@. .... .@@@ .@@. ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
876 fcb $99,$71,$E0,$00 @..@ @..@ ...@ @... @... ...@ @..@ ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
877 fcb $F1,$68,$F0,$00 .@@. .@@@ .@@. @... .@.. ...@ .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
878 fcb $E8,$88,$E0,$00 @..@ ...@ @... @... ..@. ...@ .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
879 fcb $08,$42,$10,$00 @..@ @@@. @@@@ @@@. ...@ .@@@ .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
880 fcb $71,$11,$70,$00 .... .... .... .... .... .... .... @@@@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
881 fcb $69,$00,$00,$00 .... .... .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
882 fcb $00,$00,$0F,$00 .... .... .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
883 * chars 60-67
1e312b144f4d Major changes:
boisy
parents:
diff changeset
884 fcb $22,$00,$00,$00 ..@. .... @... .... ...@ .... ..@@ ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
885 fcb $07,$99,$70,$00 ..@. .@@@ @@@. .@@@ .@@@ .@@@ .@.. .@@.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
886 fcb $8E,$99,$E0,$00 .... @..@ @..@ @... @..@ @.@. @@@@ @..@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
887 fcb $07,$88,$70,$00 .... @..@ @..@ @... @..@ @@.. .@.. @..@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
888 fcb $17,$99,$70,$00 .... .@@@ @@@. .@@@ .@@@ .@@@ .@.. .@@@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
889 fcb $07,$AC,$70,$00 .... .... .... .... .... .... .... ...@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
890 fcb $34,$F4,$40,$00 .... .... .... .... .... .... .... @@@.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
891 fcb $06,$99,$71,$E0 .... .... .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
892 * chars 68-6f
1e312b144f4d Major changes:
boisy
parents:
diff changeset
893 fcb $8E,$99,$90,$00 @... .@.. ..@. @... .@.. .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
894 fcb $40,$44,$40,$00 @@@. .... .... @.@. .@.. .@@@ .@@@ .@@.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
895 fcb $20,$22,$22,$C0 @..@ .@.. ..@. @@.. .@.. @@.@ @..@ @..@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
896 fcb $8A,$CA,$90,$00 @..@ .@.. ..@. @.@. .@.. @@.@ @..@ @..@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
897 fcb $44,$44,$40,$00 @..@ .@.. ..@. @..@ .@.. @..@ @..@ .@@.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
898 fcb $0E,$DD,$90,$00 .... .... ..@. .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
899 fcb $0E,$99,$90,$00 .... .... @@.. .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
900 fcb $06,$99,$60,$00 .... .... .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
901 * chars 70-77
1e312b144f4d Major changes:
boisy
parents:
diff changeset
902 fcb $0E,$99,$E8,$80 .... .... .... .... .@.. .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
903 fcb $07,$99,$71,$10 @@@. .@@@ .@@@ .@@@ @@@@ @..@ @..@ @..@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
904 fcb $07,$88,$80,$00 @..@ @..@ @... @@.. .@.. @..@ @..@ @@.@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
905 fcb $07,$C3,$E0,$00 @..@ @..@ @... ..@@ .@.. @..@ .@@. @@.@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
906 fcb $4F,$44,$30,$00 @@@. .@@@ @... @@@. ..@@ .@@@ .@@. .@@.
1e312b144f4d Major changes:
boisy
parents:
diff changeset
907 fcb $09,$99,$70,$00 @... ...@ .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
908 fcb $09,$96,$60,$00 @... ...@ .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
909 fcb $09,$DD,$60,$00 .... .... .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
910 * chars 78-7f
1e312b144f4d Major changes:
boisy
parents:
diff changeset
911 fcb $09,$66,$90,$00 .... .... .... ..@@ .@.. @@.. .... @@@@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
912 fcb $09,$99,$71,$E0 @..@ @..@ @@@@ .@.. .@.. ..@. .@.@ @@@@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
913 fcb $0F,$24,$F0,$00 .@@. @..@ ..@. @@.. .... ..@@ @.@. @@@@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
914 fcb $34,$C4,$30,$00 .@@. @..@ .@.. .@.. .@.. ..@. .... @@@@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
915 fcb $44,$04,$40,$00 @..@ .@@@ @@@@ ..@@ .@.. @@.. .... @@@@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
916 fcb $C2,$32,$C0,$00 .... ...@ .... .... .... .... .... @@@@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
917 fcb $05,$A0,$00,$00 .... @@@. .... .... .... .... .... @@@@
1e312b144f4d Major changes:
boisy
parents:
diff changeset
918 fcb $FF,$FF,$FF,$F0 .... .... .... .... .... .... .... ....
1e312b144f4d Major changes:
boisy
parents:
diff changeset
919
1e312b144f4d Major changes:
boisy
parents:
diff changeset
920 emod
1e312b144f4d Major changes:
boisy
parents:
diff changeset
921 eom equ *
1e312b144f4d Major changes:
boisy
parents:
diff changeset
922 end