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
|
|
17 endc
|
|
18
|
|
19 tylg set Drivr+Objct
|
|
20 atrv set ReEnt+Rev
|
|
21 rev set $00
|
|
22 edition set 1
|
|
23
|
|
24 mod eom,name,tylg,atrv,Start,Size
|
|
25
|
|
26 fcb READ.+WRITE.
|
|
27
|
|
28 name fcs /scdwp/
|
|
29 fcb edition one more revision level than the stock printer
|
|
30
|
|
31 * Device memory area: offset from U
|
|
32 org V.SCF V.SCF: free memory for driver to use
|
|
33 V.PAR rmb 1 1=space, 2=mark parity
|
|
34 V.BIT rmb 1 0=7, 1=8 bits
|
|
35 V.STP rmb 1 0=1 stop bit, 1=2 stop bits
|
|
36 V.COM rmb 2 Com Status baud/parity (=Y from SS.Comst Set/GetStt
|
|
37 V.COL rmb 1 columns
|
|
38 V.ROW rmb 1 rows
|
|
39 V.WAIT rmb 2 wait count for baud rate?
|
|
40 V.TRY rmb 2 number of re-tries if printer is busy
|
|
41 V.RTRY rmb 1 low nibble of parity=high byte of number of retries
|
|
42 V.BUFF rmb $80 room for 128 blocked processes
|
|
43 size equ .
|
|
44
|
|
45 start equ *
|
|
46 lbra Init
|
|
47 lbra Read
|
|
48 lbra Write
|
|
49 lbra GetStt
|
|
50 lbra SetStt
|
|
51
|
|
52 * Term
|
|
53 *
|
|
54 * Entry:
|
|
55 * U = address of device memory area
|
|
56 *
|
|
57 * Exit:
|
|
58 * CC = carry set on error
|
|
59 * B = error code
|
|
60 *
|
|
61 Term equ *
|
|
62 clrb
|
|
63 rts
|
|
64
|
|
65 * Init
|
|
66 *
|
|
67 * Entry:
|
|
68 * Y = address of device descriptor
|
|
69 * U = address of device memory area
|
|
70 *
|
|
71 * Exit:
|
|
72 * CC = carry set on error
|
|
73 * B = error code
|
|
74 *
|
|
75 Init
|
|
76 rts
|
|
77
|
|
78 * Write
|
|
79 *
|
|
80 * Entry:
|
|
81 * A = character to write
|
|
82 * Y = address of path descriptor
|
|
83 * U = address of device memory area
|
|
84 *
|
|
85 * Exit:
|
|
86 * CC = carry set on error
|
|
87 * B = error code
|
|
88 *
|
|
89 Write equ *
|
|
90 tfr a,b
|
|
91 lda #'Q
|
|
92 pshs d
|
|
93 leax ,s
|
|
94 ldy #$0002
|
|
95 ldu >D.DWSUB
|
|
96 jsr 6,u
|
|
97 puls d,pc
|
|
98
|
|
99
|
|
100 * GetStat
|
|
101 *
|
|
102 * Entry:
|
|
103 * A = function code
|
|
104 * Y = address of path descriptor
|
|
105 * U = address of device memory area
|
|
106 *
|
|
107 * Exit:
|
|
108 * CC = carry set on error
|
|
109 * B = error code
|
|
110 *
|
|
111 GetStt cmpa #SS.EOF end of file?
|
|
112 bne L0112
|
|
113 clrb if so, exit with no error
|
|
114 rts
|
|
115
|
|
116 L0112 ldx PD.RGS,y
|
|
117 cmpa #SS.ScSiz
|
|
118 beq L0123
|
|
119 cmpa #SS.ComSt
|
|
120 bne L0173
|
|
121 clra
|
|
122 clrb
|
|
123 std R$Y,x
|
|
124 clrb
|
|
125 rts
|
|
126
|
|
127 * get screen size GetStt
|
|
128 L0123 clra
|
|
129 ldb #80
|
|
130 std R$X,x
|
|
131 ldb #24
|
|
132 std R$Y,x
|
|
133 clrb
|
|
134 rts
|
|
135
|
|
136 * SetStat
|
|
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 SetStt
|
|
148 Close cmpa #SS.Close close the device?
|
|
149 bne L0173
|
|
150 lda #'F send PrintQueue Flush Packet
|
|
151 pshs a
|
|
152 ldy #$0001
|
|
153 leax ,s
|
|
154 ldu >D.DWSUB
|
|
155 jsr 6,u
|
|
156 puls a,pc
|
|
157
|
|
158
|
|
159 Read comb
|
|
160 ldb #E$BMode
|
|
161 rts
|
|
162
|
|
163 L0173 comb
|
|
164 ldb #E$UnkSVc
|
|
165 rts
|
|
166
|
|
167 emod
|
|
168 eom equ *
|
|
169 end
|