annotate level1/modules/scdwp.asm @ 2224:22b75f9788a5

Removed redundant targets
author boisy
date Wed, 18 Mar 2009 11:33:16 +0000
parents 0eaed2dfda42
children 07b2433f0c65
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
2183
d29be35a48bb makefiles updated, opcode for printing updated
boisy
parents: 2180
diff changeset
17 use dwdefs.d
2180
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
18 endc
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
19
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
20 tylg set Drivr+Objct
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
21 atrv set ReEnt+Rev
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
22 rev set $00
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
23 edition set 1
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
24
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
25 mod eom,name,tylg,atrv,Start,Size
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
26
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
27 fcb READ.+WRITE.
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
28
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
29 name fcs /scdwp/
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
30 fcb edition one more revision level than the stock printer
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
31
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
32 * Device memory area: offset from U
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
33 org V.SCF V.SCF: free memory for driver to use
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
34 V.PAR rmb 1 1=space, 2=mark parity
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
35 V.BIT rmb 1 0=7, 1=8 bits
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
36 V.STP rmb 1 0=1 stop bit, 1=2 stop bits
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
37 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
38 V.COL rmb 1 columns
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
39 V.ROW rmb 1 rows
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
40 V.WAIT rmb 2 wait count for baud rate?
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
41 V.TRY rmb 2 number of re-tries if printer is busy
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
42 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
43 V.BUFF rmb $80 room for 128 blocked processes
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
44 size equ .
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
45
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
46 start equ *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
47 lbra Init
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
48 lbra Read
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
49 lbra Write
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
50 lbra GetStt
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
51 lbra SetStt
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
52
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
53 * Term
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
54 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
55 * Entry:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
56 * U = address of device memory area
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
57 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
58 * Exit:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
59 * CC = carry set on error
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
60 * B = error code
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
61 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
62 Term equ *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
63 clrb
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
64 rts
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
65
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
66 * Init
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
67 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
68 * Entry:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
69 * Y = address of device descriptor
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
70 * U = address of device memory area
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
71 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
72 * Exit:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
73 * CC = carry set on error
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
74 * B = error code
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
75 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
76 Init
2213
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
77 * Check if D.DWSUB already holds a valid subroutine module pointer
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
78 IFGT Level-1
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
79 ldx <D.DWSUB
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
80 ELSE
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
81 ldx >D.DWSUB
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
82 ENDC
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
83 bne InitEx
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
84
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
85 * If here, D.DWSUB is 0, so we must link to subroutine module
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
86 IFGT Level-1
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
87 ldx <D.Proc
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
88 pshs x
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
89 ldx <D.SysPrc
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
90 stx <D.Proc
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
91 ENDC
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
92 clra
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
93 leax dw3name,pcr
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
94 os9 F$Link
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
95 IFGT Level-1
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
96 puls x
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
97 stx <D.Proc
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
98 ENDC
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
99 bcs InitEx
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
100 IFGT Level-1
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
101 sty <D.DWSUB
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
102 ELSE
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
103 sty >D.DWSUB
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
104 ENDC
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
105 jsr ,y call init routine
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
106 InitEx rts
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
107
0eaed2dfda42 Updated
boisy
parents: 2183
diff changeset
108 dw3name fcs /dw3/
2180
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
109
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
110 * Write
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
111 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
112 * Entry:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
113 * A = character to write
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
114 * Y = address of path descriptor
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
115 * U = address of device memory area
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
116 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
117 * Exit:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
118 * CC = carry set on error
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
119 * B = error code
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
120 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
121 Write equ *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
122 tfr a,b
2183
d29be35a48bb makefiles updated, opcode for printing updated
boisy
parents: 2180
diff changeset
123 lda #OP_PRINT
2180
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
124 pshs d
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
125 leax ,s
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
126 ldy #$0002
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
127 ldu >D.DWSUB
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
128 jsr 6,u
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
129 puls d,pc
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
130
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
131
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
132 * GetStat
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
133 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
134 * Entry:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
135 * A = function code
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
136 * Y = address of path descriptor
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
137 * U = address of device memory area
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
138 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
139 * Exit:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
140 * CC = carry set on error
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
141 * B = error code
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
142 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
143 GetStt cmpa #SS.EOF end of file?
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
144 bne L0112
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
145 clrb if so, exit with no error
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
146 rts
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
147
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
148 L0112 ldx PD.RGS,y
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
149 cmpa #SS.ScSiz
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
150 beq L0123
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
151 cmpa #SS.ComSt
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
152 bne L0173
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
153 clra
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
154 clrb
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
155 std R$Y,x
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
156 clrb
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
157 rts
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
158
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
159 * get screen size GetStt
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
160 L0123 clra
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
161 ldb #80
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
162 std R$X,x
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
163 ldb #24
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
164 std R$Y,x
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
165 clrb
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
166 rts
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
167
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
168 * SetStat
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
169 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
170 * Entry:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
171 * A = function code
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
172 * Y = address of path descriptor
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
173 * U = address of device memory area
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
174 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
175 * Exit:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
176 * CC = carry set on error
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
177 * B = error code
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
178 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
179 SetStt
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
180 Close cmpa #SS.Close close the device?
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
181 bne L0173
2183
d29be35a48bb makefiles updated, opcode for printing updated
boisy
parents: 2180
diff changeset
182 lda #OP_PRINTFLUSH send PrintQueue Flush Packet
2180
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
183 pshs a
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
184 ldy #$0001
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
185 leax ,s
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
186 ldu >D.DWSUB
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
187 jsr 6,u
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
188 puls a,pc
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
189
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
190
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
191 Read comb
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
192 ldb #E$BMode
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
193 rts
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
194
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
195 L0173 comb
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
196 ldb #E$UnkSVc
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
197 rts
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
198
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
199 emod
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
200 eom equ *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
201 end