annotate level1/modules/co80.asm @ 1933:1e312b144f4d

Major changes: CCIO,CC3IO are now VTIO GrfInt is now CoGrf WindInt is now CoWin VDGInt (L2), CO32 (L1) is now CoVDG CO51 (L1) is now CoHR CO80 (L1) is now CoWP All files referencing these have been changed
author boisy
date Sat, 26 Nov 2005 21:31:29 +0000
parents afae4d350682
children 6e40b043d3e0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1 ********************************************************************
1933
1e312b144f4d Major changes:
boisy
parents: 1738
diff changeset
2 * CO80 - Mysterious 80 Column Co-Driver for VTIO
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
3 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
4 * $Id$
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
5 *
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
6 * This driver came with OS-9 Level One V2.00, yet it does not
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
7 * seem to be written for the WordPak RS.
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
8 *
1499
6cd590fc076f Fixed comments
boisy
parents: 1287
diff changeset
9 * Edt/Rev YYYY/MM/DD Modified by
6cd590fc076f Fixed comments
boisy
parents: 1287
diff changeset
10 * Comment
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
11 * ------------------------------------------------------------------
1499
6cd590fc076f Fixed comments
boisy
parents: 1287
diff changeset
12 * 2 ????/??/??
6cd590fc076f Fixed comments
boisy
parents: 1287
diff changeset
13 * From Tandy OS-9 Level One VR 02.00.00
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
14 *
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
15 * 2003/09/22 Rodney Hamilton
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
16 * recoded dispatch table fcbs
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
17
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
18 nam CO80
1933
1e312b144f4d Major changes:
boisy
parents: 1738
diff changeset
19 ttl Mysterious 80 column co-driver for VTIO
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
20
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
21 BASEADDR equ $FF78
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
22
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
23 ifp1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
24 use defsfile
1933
1e312b144f4d Major changes:
boisy
parents: 1738
diff changeset
25 use vtiodefs
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
26 endc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
27
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
28 tylg set Systm+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
29 atrv set ReEnt+rev
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
30 rev set $01
201
668388823050 Fixed headers to be consistent
boisy
parents: 0
diff changeset
31 edition set 2
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
32
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
33 mod eom,name,tylg,atrv,start,size
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
34
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
35 u0000 rmb 0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
36 size equ .
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
37 fcb $06
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
38
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
39 name fcs /CO80/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
40 fcb edition
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
41
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
42 start equ *
1582
e19a38f50c3a More commments added
boisy
parents: 1512
diff changeset
43 lbra Init
e19a38f50c3a More commments added
boisy
parents: 1512
diff changeset
44 lbra Write
e19a38f50c3a More commments added
boisy
parents: 1512
diff changeset
45 lbra GetStat
e19a38f50c3a More commments added
boisy
parents: 1512
diff changeset
46 lbra SetStat
e19a38f50c3a More commments added
boisy
parents: 1512
diff changeset
47 lbra Term
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
48
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
49 * Init
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
50 Init ldx #BASEADDR
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
51 lda #$06 Vertical Displayed Rows
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
52 sta $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
53 sta ,x
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
54 lda #$08 Mode Control
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
55 sta $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
56 clr ,x
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
57 lda #$0E Cursor Position Address
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
58 sta $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
59 clr ,x
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
60 lbsr CurHome
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
61 lbsr CurOn
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
62 ldd #80*25
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
63 lbsr L0189
1585
4a2a4667a4cf Source enhancements
boisy
parents: 1582
diff changeset
64 ldb <V.COLoad,u
1736
fd288a57f6ab CO51 additions by Phill
boisy
parents: 1586
diff changeset
65 orb #ModCo80
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
66 bra L004F
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
67 * Term
1585
4a2a4667a4cf Source enhancements
boisy
parents: 1582
diff changeset
68 Term ldb <V.COLoad,u
1736
fd288a57f6ab CO51 additions by Phill
boisy
parents: 1586
diff changeset
69 andb #~ModCo80
1585
4a2a4667a4cf Source enhancements
boisy
parents: 1582
diff changeset
70 L004F stb <V.COLoad,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
71 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
72 rts
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
73 * GetStat
1585
4a2a4667a4cf Source enhancements
boisy
parents: 1582
diff changeset
74 GetStat cmpa #SS.Cursr
1582
e19a38f50c3a More commments added
boisy
parents: 1512
diff changeset
75 bne SetStat
1585
4a2a4667a4cf Source enhancements
boisy
parents: 1582
diff changeset
76 ldy R$Y,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
77 clra
1585
4a2a4667a4cf Source enhancements
boisy
parents: 1582
diff changeset
78 ldb <V.C80X,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
79 addb #$20
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
80 std $06,y
1585
4a2a4667a4cf Source enhancements
boisy
parents: 1582
diff changeset
81 ldb <V.C80Y,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
82 addb #$20
1585
4a2a4667a4cf Source enhancements
boisy
parents: 1582
diff changeset
83 std R$X,y
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
84 ldx #BASEADDR
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
85 lda #$0D Display Start Address
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
86 sta $01,x
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
87 lbsr WaitBUSY
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
88 lda ,x
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
89 lbsr WaitBUSY
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
90 lda ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
91 sta $01,y
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
92 * no operation entry point
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
93 NoOp clrb
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
94 rts
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
95 * SetStat
1582
e19a38f50c3a More commments added
boisy
parents: 1512
diff changeset
96 SetStat ldb #E$UnkSvc
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
97 coma
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
98 rts
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
99 * Write
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
100 Write ldx #BASEADDR get HW addr in X
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
101 cmpa #$0E $0E?
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
102 bcs L00B6 branch if less than
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
103 cmpa #$1E $1E?
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
104 bcs NoOp branch if less than
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
105 cmpa #C$SPAC space?
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
106 lbcs Check1F branch if less than
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
107 cmpa #$7F $7F?
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
108 bcs ChrOut ASCII char, branch if less than
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
109 cmpa #$C0 $C0?
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
110 bls L00A6 branch if lower or same
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
111 anda #$1F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
112 suba #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
113 cmpa #$19
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
114 bhi L00B2
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
115 bra ChrOut
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
116 L00A6 cmpa #$AA $AA?
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
117 bcs L00B2 branch if less than
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
118 ora #$10
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
119 anda #$1F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
120 cmpa #$1A
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
121 bcc ChrOut
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
122 L00B2 lda #$7F
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
123 bra ChrOut
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
124
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
125 L00B6 leax >FuncTbl,pcr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
126 lsla
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
127 ldd a,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
128 leax d,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
129 pshs x
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
130 ldx #BASEADDR
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
131 rts
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
132
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
133 * display functions dispatch table
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
134 FuncTbl fdb NoOp-FuncTbl $00:no-op (null)
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
135 fdb CurHome-FuncTbl $01:HOME cursor
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
136 fdb CurXY-FuncTbl $02:CURSOR XY
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
137 fdb ErLine-FuncTbl $03:ERASE LINE
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
138 fdb ErEOL-FuncTbl $04:ERASE TO EOL
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
139 fdb CurOnOff-FuncTbl $05:CURSOR ON/OFF
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
140 fdb CurRgt-FuncTbl $06:CURSOR RIGHT
1933
1e312b144f4d Major changes:
boisy
parents: 1738
diff changeset
141 fdb NoOp-FuncTbl $07:no-op (bel:handled in VTIO)
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
142 fdb CurLft-FuncTbl $08:CURSOR LEFT
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
143 fdb CurUp-FuncTbl $09:CURSOR UP
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
144 fdb CurDown-FuncTbl $0A:CURSOR DOWN
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
145 fdb ErEOS-FuncTbl $0B:ERASE TO EOS
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
146 fdb ClrScrn-FuncTbl $0C:CLEAR SCREEN
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
147 fdb CrRtn-FuncTbl $0D:RETURN
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
148
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
149 * $08 - cursor left
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
150 CurLft ldd <V.C80X,u get CO80 X/Y
1585
4a2a4667a4cf Source enhancements
boisy
parents: 1582
diff changeset
151 bne L00E8 branch if not at start
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
152 clrb
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
153 rts
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
154 L00E8 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
155 bge L00EE
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
156 ldb #79
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
157 deca
1585
4a2a4667a4cf Source enhancements
boisy
parents: 1582
diff changeset
158 L00EE std <V.C80X,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
159 bra L014F
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
160
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
161 * $09 - cursor up
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
162 CurUp lda <V.C80X,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
163 beq L00FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
164 deca
1585
4a2a4667a4cf Source enhancements
boisy
parents: 1582
diff changeset
165 sta <V.C80X,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
166 lbra L01CC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
167 L00FF clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
168 rts
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
169
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
170 * $0D - move cursor to start of line (carriage return)
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
171 CrRtn clr <V.C80Y,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
172 bra L014C
1585
4a2a4667a4cf Source enhancements
boisy
parents: 1582
diff changeset
173
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
174 * ChrOut - output a readable character
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
175 * Entry: A = ASCII value of character to output
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
176 ChrOut ora <V.Invers,u add inverse video flag
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
177 pshs a save char
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
178 bsr WaitBUSY wait for HW
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
179 puls a restore char
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
180 ldb #$0D Display Start Address
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
181 stb $01,x
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
182 sta ,x write character
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
183
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
184 * $06 - cursor right
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
185 CurRgt inc <V.C80Y,u
1585
4a2a4667a4cf Source enhancements
boisy
parents: 1582
diff changeset
186 lda <V.C80Y,u
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
187 cmpa #79
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
188 ble L014C
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
189 bsr CrRtn
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
190
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
191 * $0A - cursor down (line feed)
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
192 CurDown lda <V.C80X,u
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
193 cmpa #23
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
194 bge L012E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
195 inca
1585
4a2a4667a4cf Source enhancements
boisy
parents: 1582
diff changeset
196 sta <V.C80X,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
197 bra L014F
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
198 L012E ldd <V.Co80X,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
199 lbsr L01DC
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
200 ldd <V.Co80X,u
1585
4a2a4667a4cf Source enhancements
boisy
parents: 1582
diff changeset
201 addd #80
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
202 bsr L0161
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
203 std <V.Co80X,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
204 bsr L018E
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
205 ldd <V.Co80X,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
206 bsr L016B
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
207 lda #$08 Mode Control
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
208 sta $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
209 stb ,x
1585
4a2a4667a4cf Source enhancements
boisy
parents: 1582
diff changeset
210 L014C lda <V.C80X,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
211 L014F lbra L01CC
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
212
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
213 * $01 - home cursor
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
214 CurHome clr <V.C80X,u
1585
4a2a4667a4cf Source enhancements
boisy
parents: 1582
diff changeset
215 clr <V.C80Y,u
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
216 ldd <V.Co80X,u
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
217 std <V.ColPtr,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
218 lbra L01DC
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
219 L0161 cmpd #80*25
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
220 blt L016A
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
221 subd #80*25
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
222 L016A rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
223 L016B lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
224 rorb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
225 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
226 rorb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
227 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
228 rorb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
229 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
230 rorb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
231 rts
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
232
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
233 * X = address of WordPak
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
234 WaitBUSY lda $01,x
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
235 bpl WaitBUSY
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
236 rts
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
237
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
238 * $03 - erase line
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
239 ErLine bsr CrRtn do a CR
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
240 ErEOL lda <V.C80X,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
241 inca
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
242 ldb #80 line length
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
243 mul
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
244 bra L0189
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
245
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
246 * $0C - clear screen
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
247 ClrScrn bsr CurHome do home cursor, then erase to EOS
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
248
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
249 * $0B - erase to end of screen
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
250 ErEOS ldd #80*24
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
251 L0189 addd <V.Co80X,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
252 bsr L0161
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
253 L018E bsr L016B
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
254 bsr WaitBUSY
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
255 lda #$0B Cursor End Line
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
256 sta $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
257 stb ,x
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
258 lda #$0D Display Start Address
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
259 sta $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
260 lda #$20
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
261 sta ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
262 L01A0 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
263 rts
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
264
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
265 * $02 XX YY - move cursor to col XX-32, row YY-32
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
266 CurXY leax >L01B0,pcr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
267 ldb #$02
1585
4a2a4667a4cf Source enhancements
boisy
parents: 1582
diff changeset
268 L01A8 stx <V.RTAdd,u
4a2a4667a4cf Source enhancements
boisy
parents: 1582
diff changeset
269 stb <V.NGChr,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
270 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
271 rts
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
272 L01B0 ldx #BASEADDR get HW address
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
273 lda <V.NChr2,u get char2 in A
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
274 ldb <V.NChar,u and char1 in B
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
275 subb #32 subtract 32 from B
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
276 blt L01A0 if less than 0, we're done
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
277 cmpb #79 compare against greatest column
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
278 bgt L01A0 branch if >79
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
279 suba #32 else subtract 32 from A
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
280 blt L01A0 if less than 0, we're done
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
281 cmpa #23 compare against greatest row
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
282 bgt L01A0 branch if >23
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
283 std <V.C80X,u else store A/B in new col/row position
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
284 L01CC ldb #80 multiply A*80 to find new row
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
285 mul
1585
4a2a4667a4cf Source enhancements
boisy
parents: 1582
diff changeset
286 addb <V.C80Y,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
287 adca #$00
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
288 addd <V.Co80X,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
289 bsr L0161
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
290 std <V.ColPtr,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
291 L01DC pshs b,a
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
292 bsr WaitBUSY
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
293 lda #$0A Cursor Start Line
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
294 sta $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
295 lda ,s+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
296 sta ,x
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
297 lda #$09 Number of Scan Lines
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
298 sta $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
299 lda ,s+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
300 sta ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
301 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
302 rts
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
303
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
304 Check1F cmpa #$1F
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
305 bne WritErr
1585
4a2a4667a4cf Source enhancements
boisy
parents: 1582
diff changeset
306 lda <V.NChr2,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
307 cmpa #$21
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
308 beq InvOn
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
309 cmpa #$20
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
310 beq InvOff
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
311 WritErr comb
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
312 ldb #E$Write
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
313 rts
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
314
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
315 InvOn lda #$80
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
316 sta <V.Invers,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
317 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
318 rts
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
319
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
320 InvOff clr <V.Invers,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
321 L020F clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
322 rts
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
323
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
324 * $05 XX - set cursor off/on/color per XX-32
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
325 CurOnOff leax >L0219,pcr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
326 ldb #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
327 bra L01A8
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
328 L0219 ldx #BASEADDR
1585
4a2a4667a4cf Source enhancements
boisy
parents: 1582
diff changeset
329 lda <V.NChr2,u get next character
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
330 cmpa #$20 cursor code valid?
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
331 blt WritErr no, error
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
332 beq L022D
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
333 cmpa #$2A color code in range?
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
334 bgt L020F no, ignore
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
335 CurOn lda #$05 cursor on (all colors=on)
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
336 bra L022F
1512
f3557a63b11c Rodney's improvements
boisy
parents: 1499
diff changeset
337 L022D lda #$45 cursor off
1738
afae4d350682 Updated source, reset revision to 1 so assembles identical to original
boisy
parents: 1736
diff changeset
338 L022F ldb #$0C
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
339 stb $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
340 sta ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
341 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
342 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
343
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
344 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
345 eom equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
346 end