annotate level1/modules/scdwp.asm @ 2183:d29be35a48bb

makefiles updated, opcode for printing updated
author boisy
date Sun, 08 Mar 2009 22:28:45 +0000
parents 660cc987e18d
children 0eaed2dfda42
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
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
77 rts
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
78
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
79 * Write
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
80 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
81 * Entry:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
82 * A = character to write
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
83 * Y = address of path descriptor
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
84 * U = address of device memory area
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
85 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
86 * Exit:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
87 * CC = carry set on error
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
88 * B = error code
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
89 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
90 Write equ *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
91 tfr a,b
2183
d29be35a48bb makefiles updated, opcode for printing updated
boisy
parents: 2180
diff changeset
92 lda #OP_PRINT
2180
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
93 pshs d
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
94 leax ,s
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
95 ldy #$0002
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
96 ldu >D.DWSUB
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
97 jsr 6,u
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
98 puls d,pc
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
99
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
100
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
101 * GetStat
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
102 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
103 * Entry:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
104 * A = function code
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
105 * Y = address of path descriptor
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
106 * U = address of device memory area
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
107 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
108 * Exit:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
109 * CC = carry set on error
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
110 * B = error code
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
111 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
112 GetStt cmpa #SS.EOF end of file?
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
113 bne L0112
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
114 clrb if so, exit with no error
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
115 rts
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
116
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
117 L0112 ldx PD.RGS,y
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
118 cmpa #SS.ScSiz
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
119 beq L0123
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
120 cmpa #SS.ComSt
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
121 bne L0173
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
122 clra
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
123 clrb
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
124 std R$Y,x
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
125 clrb
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
126 rts
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
127
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
128 * get screen size GetStt
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
129 L0123 clra
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
130 ldb #80
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
131 std R$X,x
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
132 ldb #24
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
133 std R$Y,x
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
134 clrb
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
135 rts
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
136
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
137 * SetStat
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
138 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
139 * Entry:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
140 * A = function code
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
141 * Y = address of path descriptor
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
142 * U = address of device memory area
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
143 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
144 * Exit:
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
145 * CC = carry set on error
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
146 * B = error code
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
147 *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
148 SetStt
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
149 Close cmpa #SS.Close close the device?
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
150 bne L0173
2183
d29be35a48bb makefiles updated, opcode for printing updated
boisy
parents: 2180
diff changeset
151 lda #OP_PRINTFLUSH send PrintQueue Flush Packet
2180
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
152 pshs a
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
153 ldy #$0001
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
154 leax ,s
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
155 ldu >D.DWSUB
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
156 jsr 6,u
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
157 puls a,pc
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
158
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
159
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
160 Read comb
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
161 ldb #E$BMode
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
162 rts
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
163
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
164 L0173 comb
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
165 ldb #E$UnkSVc
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 emod
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
169 eom equ *
660cc987e18d Added DriveWire 3 modules to distribution
boisy
parents:
diff changeset
170 end