Mercurial > hg > Members > kono > nitros9-code
annotate level1/modules/scdwp.asm @ 3047:a951ab0b3003
level1 6309: Switch to native mode early in rel.asm
Otherwise it will crash in the first F$Link call.
author | Robert Gault <robert.gault@att.net> |
---|---|
date | Sat, 24 Jan 2015 23:15:55 +0100 |
parents | 05b648103e78 |
children |
rev | line source |
---|---|
2180 | 1 ******************************************************************** |
2 * scdwp.asm - CoCo DriveWire Printer Driver | |
3 * | |
4 * $Id$ | |
5 * | |
6 * Edt/Rev YYYY/MM/DD Modified by | |
7 * Comment | |
8 * ------------------------------------------------------------------ | |
9 * 1 2009/03/06 Boisy G. Pitre | |
10 * Started. | |
11 | |
12 nam scdwp | |
13 ttl CoCo DriveWire Printer Driver | |
14 | |
15 ifp1 | |
16 use defsfile | |
2624 | 17 use drivewire.d |
2180 | 18 endc |
19 | |
20 tylg set Drivr+Objct | |
21 atrv set ReEnt+Rev | |
22 rev set $00 | |
23 edition set 1 | |
24 | |
25 mod eom,name,tylg,atrv,Start,Size | |
26 | |
27 fcb READ.+WRITE. | |
28 | |
29 name fcs /scdwp/ | |
30 fcb edition one more revision level than the stock printer | |
31 | |
32 * Device memory area: offset from U | |
33 org V.SCF V.SCF: free memory for driver to use | |
34 V.PAR rmb 1 1=space, 2=mark parity | |
35 V.BIT rmb 1 0=7, 1=8 bits | |
36 V.STP rmb 1 0=1 stop bit, 1=2 stop bits | |
37 V.COM rmb 2 Com Status baud/parity (=Y from SS.Comst Set/GetStt | |
38 V.COL rmb 1 columns | |
39 V.ROW rmb 1 rows | |
40 V.WAIT rmb 2 wait count for baud rate? | |
41 V.TRY rmb 2 number of re-tries if printer is busy | |
42 V.RTRY rmb 1 low nibble of parity=high byte of number of retries | |
43 V.BUFF rmb $80 room for 128 blocked processes | |
44 size equ . | |
45 | |
46 start equ * | |
47 lbra Init | |
48 lbra Read | |
49 lbra Write | |
50 lbra GetStt | |
51 lbra SetStt | |
52 | |
53 * Term | |
54 * | |
55 * Entry: | |
56 * U = address of device memory area | |
57 * | |
58 * Exit: | |
59 * CC = carry set on error | |
60 * B = error code | |
61 * | |
62 Term equ * | |
63 clrb | |
64 rts | |
65 | |
66 * Init | |
67 * | |
68 * Entry: | |
69 * Y = address of device descriptor | |
70 * U = address of device memory area | |
71 * | |
72 * Exit: | |
73 * CC = carry set on error | |
74 * B = error code | |
75 * | |
76 Init | |
2270
07b2433f0c65
moved dwdefs.d to defs/, major changes to drivers due to new globals arrangement.
boisy
parents:
2213
diff
changeset
|
77 * Check if D.DWSubAddr already holds a valid subroutine module pointer |
2213 | 78 IFGT Level-1 |
2270
07b2433f0c65
moved dwdefs.d to defs/, major changes to drivers due to new globals arrangement.
boisy
parents:
2213
diff
changeset
|
79 ldx <D.DWSubAddr |
2213 | 80 ELSE |
2270
07b2433f0c65
moved dwdefs.d to defs/, major changes to drivers due to new globals arrangement.
boisy
parents:
2213
diff
changeset
|
81 ldx >D.DWSubAddr |
2213 | 82 ENDC |
83 bne InitEx | |
84 | |
2270
07b2433f0c65
moved dwdefs.d to defs/, major changes to drivers due to new globals arrangement.
boisy
parents:
2213
diff
changeset
|
85 * If here, D.DWSubAddr is 0, so we must link to subroutine module |
2213 | 86 IFGT Level-1 |
87 ldx <D.Proc | |
88 pshs x | |
89 ldx <D.SysPrc | |
90 stx <D.Proc | |
91 ENDC | |
92 clra | |
2724
05b648103e78
Renamed dw3.sb to dwio.sb and rbdw3 to rbdw
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
93 leax dwioname,pcr |
2213 | 94 os9 F$Link |
95 IFGT Level-1 | |
96 puls x | |
97 stx <D.Proc | |
98 ENDC | |
99 bcs InitEx | |
100 IFGT Level-1 | |
2270
07b2433f0c65
moved dwdefs.d to defs/, major changes to drivers due to new globals arrangement.
boisy
parents:
2213
diff
changeset
|
101 sty <D.DWSubAddr |
2213 | 102 ELSE |
2270
07b2433f0c65
moved dwdefs.d to defs/, major changes to drivers due to new globals arrangement.
boisy
parents:
2213
diff
changeset
|
103 sty >D.DWSubAddr |
2213 | 104 ENDC |
105 jsr ,y call init routine | |
106 InitEx rts | |
107 | |
2724
05b648103e78
Renamed dw3.sb to dwio.sb and rbdw3 to rbdw
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
108 dwioname fcs /dwio/ |
2180 | 109 |
110 * Write | |
111 * | |
112 * Entry: | |
113 * A = character to write | |
114 * Y = address of path descriptor | |
115 * U = address of device memory area | |
116 * | |
117 * Exit: | |
118 * CC = carry set on error | |
119 * B = error code | |
120 * | |
121 Write equ * | |
122 tfr a,b | |
2183 | 123 lda #OP_PRINT |
2180 | 124 pshs d |
125 leax ,s | |
126 ldy #$0002 | |
2308 | 127 IFGT Level-1 |
128 ldu <D.DWSubAddr | |
129 ELSE | |
2270
07b2433f0c65
moved dwdefs.d to defs/, major changes to drivers due to new globals arrangement.
boisy
parents:
2213
diff
changeset
|
130 ldu >D.DWSubAddr |
2308 | 131 ENDC |
2180 | 132 jsr 6,u |
133 puls d,pc | |
134 | |
135 | |
136 * GetStat | |
137 * | |
138 * Entry: | |
139 * A = function code | |
140 * Y = address of path descriptor | |
141 * U = address of device memory area | |
142 * | |
143 * Exit: | |
144 * CC = carry set on error | |
145 * B = error code | |
146 * | |
147 GetStt cmpa #SS.EOF end of file? | |
148 bne L0112 | |
149 clrb if so, exit with no error | |
150 rts | |
151 | |
152 L0112 ldx PD.RGS,y | |
153 cmpa #SS.ScSiz | |
154 beq L0123 | |
155 cmpa #SS.ComSt | |
156 bne L0173 | |
157 clra | |
158 clrb | |
159 std R$Y,x | |
160 clrb | |
161 rts | |
162 | |
163 * get screen size GetStt | |
164 L0123 clra | |
165 ldb #80 | |
166 std R$X,x | |
167 ldb #24 | |
168 std R$Y,x | |
169 clrb | |
170 rts | |
171 | |
172 * SetStat | |
173 * | |
174 * Entry: | |
175 * A = function code | |
176 * Y = address of path descriptor | |
177 * U = address of device memory area | |
178 * | |
179 * Exit: | |
180 * CC = carry set on error | |
181 * B = error code | |
182 * | |
183 SetStt | |
184 Close cmpa #SS.Close close the device? | |
185 bne L0173 | |
2183 | 186 lda #OP_PRINTFLUSH send PrintQueue Flush Packet |
2180 | 187 pshs a |
188 ldy #$0001 | |
189 leax ,s | |
2308 | 190 IFGT Level-1 |
191 ldu <D.DWSubAddr | |
192 ELSE | |
2270
07b2433f0c65
moved dwdefs.d to defs/, major changes to drivers due to new globals arrangement.
boisy
parents:
2213
diff
changeset
|
193 ldu >D.DWSubAddr |
2308 | 194 ENDC |
2180 | 195 jsr 6,u |
196 puls a,pc | |
197 | |
198 Read comb | |
199 ldb #E$BMode | |
200 rts | |
201 | |
202 L0173 comb | |
203 ldb #E$UnkSVc | |
204 rts | |
205 | |
206 emod | |
207 eom equ * | |
208 end |