annotate level1/modules/scdwp.asm @ 2180:660cc987e18d

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