0
|
1 ************************************************************
|
|
2 * MODE - Multi-purpose setting utility
|
|
3 *
|
|
4 * By: Boisy G. Pitre
|
|
5 * Southern Station, Box 8455
|
|
6 * Hattiesburg, MS 39406-8455
|
|
7 * Internet: bgpitre@seabass.st.usm.edu
|
|
8 *
|
|
9 * UPDATE LOG
|
|
10 *
|
|
11 * 01/26/92 Optimized code
|
|
12
|
|
13 * 06/23/91 Added GetStt call to get window colors
|
|
14 * for complete restoration upon 40/80 column changes
|
|
15 *
|
|
16 * 07/07/91 Added 'D' option and expanded Window types from 40 and 80
|
|
17 * to text and graphics types (1, 2, 5, 6, 7, 8)
|
|
18
|
|
19 nam Mode
|
|
20 ttl Multi-purpose setting utility
|
|
21
|
|
22 ifp1
|
|
23 use defsfile
|
|
24 endc
|
|
25
|
1242
|
26 mod Size,Name,Prgrm+Objct,ReEnt+1,Start,Fin
|
0
|
27
|
|
28 Name fcs /Mode/
|
1260
|
29 fcb $06
|
0
|
30
|
1260
|
31 Helpmess fdb C$LF,C$CR
|
0
|
32 fcc /Mode - (C) 1992 Boisy G. Pitre/
|
1260
|
33 fdb C$LF,C$CR
|
0
|
34 fcc / Usage: MODE <opts>/
|
1260
|
35 fdb C$LF,C$CR
|
0
|
36 fcc / D - Display settings/
|
1260
|
37 fdb C$LF,C$CR
|
0
|
38 fcc / R - RGB/
|
1260
|
39 fdb C$LF,C$CR
|
0
|
40 fcc / C - Composite/
|
1260
|
41 fdb C$LF,C$CR
|
0
|
42 fcc / M - Monochrome/
|
1260
|
43 fdb C$LF,C$CR
|
0
|
44 fcc / F - Fast CPU/
|
1260
|
45 fdb C$LF,C$CR
|
0
|
46 fcc / S - Slow CPU/
|
1260
|
47 fdb C$LF,C$CR
|
0
|
48 fcc / # - Window type/
|
1260
|
49 fdb C$LF,C$CR
|
0
|
50 Type1 fcc /Type 1 - 40 x 24 text/
|
1260
|
51 CR fdb C$LF,C$CR
|
0
|
52 Type2 fcc /Type 2 - 80 x 24 text/
|
1260
|
53 fdb C$LF,C$CR
|
0
|
54 Type5 fcc /Type 5 - 640 x 192, 2 color graphics/
|
1260
|
55 fdb C$LF,C$CR
|
0
|
56 Type6 fcc /Type 6 - 320 x 192, 4 color graphics/
|
1260
|
57 fdb C$LF,C$CR
|
0
|
58 Type7 fcc /Type 7 - 640 x 192, 4 color graphics/
|
1260
|
59 fdb C$LF,C$CR
|
0
|
60 Type8 fcc /Type 8 - 320 x 192, 16 color graphics/
|
1260
|
61 fdb C$LF,C$CR
|
0
|
62 Helplen equ *-Helpmess
|
|
63
|
1260
|
64 Fastmess fdb C$LF,C$CR
|
0
|
65 fcc /CPU is set to FAST (1.78Mhz)/
|
1260
|
66 fdb C$LF,C$CR
|
0
|
67
|
1260
|
68 Slowmess fdb C$LF,C$CR
|
0
|
69 fcc /CPU is set to SLOW (0.89Mhz)/
|
1260
|
70 fdb C$LF,C$CR
|
0
|
71
|
|
72 BadParm fcc /: Bad parameter/
|
1260
|
73 fcb C$CR
|
0
|
74
|
|
75 VDG fcc /32 x 16 VDG text screen/
|
1260
|
76 fdb C$LF,C$CR
|
0
|
77
|
|
78 W1 fcb $1b,$24,$1b,$20,$01,$00,$00,$28,$18
|
|
79 W2 fcb $1b,$24,$1b,$20,$02,$00,$00,$50,$18
|
|
80 W5 fcb $1b,$24,$1b,$20,$05,$00,$00,$50,$18
|
|
81 W6 fcb $1b,$24,$1b,$20,$06,$00,$00,$28,$18
|
|
82 W7 fcb $1b,$24,$1b,$20,$07,$00,$00,$50,$18
|
|
83 W8 fcb $1b,$24,$1b,$20,$08,$00,$00,$28,$18
|
|
84 Select fdb $1b21
|
|
85
|
|
86 Colors rmb 4
|
|
87 Stack rmb 200
|
|
88 Parms rmb 200
|
|
89 Fin equ .
|
|
90
|
|
91 Start decb Decrement B
|
|
92 beq Help if no params, show help
|
|
93
|
|
94 * Parsing routine
|
|
95
|
|
96 Parse2 lda ,x+ load A with next char.
|
1260
|
97 Parse3 cmpa #C$CR is it a CR?
|
0
|
98 lbeq Done Yep, done
|
1260
|
99 cmpa #C$SPAC is it a space?
|
0
|
100 beq Parse2 yep, get next char
|
|
101 cmpa #'1 Check for window types...
|
|
102 lbeq Win1
|
|
103 cmpa #'2
|
|
104 lbeq Win2
|
|
105 cmpa #'5
|
|
106 lbeq Win5
|
|
107 cmpa #'6
|
|
108 lbeq Win6
|
|
109 cmpa #'7
|
|
110 lbeq Win7
|
|
111 cmpa #'8
|
|
112 lbeq Win8
|
1260
|
113 anda #$DF Mask to uppercase
|
0
|
114 cmpa #'D Check other opts...
|
|
115 lbeq Query
|
|
116 cmpa #'R
|
|
117 beq RGB
|
|
118 cmpa #'C
|
|
119 beq CMP
|
|
120 cmpa #'M
|
|
121 beq MONO
|
|
122 cmpa #'F
|
|
123 lbeq Fast
|
|
124 cmpa #'S
|
|
125 lbeq Slow
|
|
126
|
|
127 * Bad parameter message
|
|
128
|
|
129 pshs x
|
|
130 ldy #1
|
|
131 leax -1,x
|
|
132 lda #2
|
|
133 os9 I$Write
|
|
134 bcs Error
|
|
135 leax BadParm,pcr
|
|
136 ldy #25
|
|
137 os9 I$WritLn
|
|
138 bcs Error
|
|
139 puls x
|
|
140 bra Parse2
|
|
141
|
1242
|
142 Help leax Helpmess,pcr
|
0
|
143 ldy #Helplen
|
|
144 lda #1
|
|
145 os9 I$Write
|
|
146 bra Done
|
|
147
|
|
148 RGB pshs x
|
|
149 ldx #$0001
|
|
150 bra Monitor
|
|
151
|
|
152 CMP pshs x
|
|
153 ldx #$0000
|
|
154 bra Monitor
|
|
155
|
|
156 MONO pshs x
|
|
157 ldx #$0002
|
|
158
|
|
159 Monitor lda #1
|
|
160 ldb #$92
|
|
161 os9 I$SetStt
|
|
162 bcs Error
|
|
163 puls x
|
|
164 lbra Parse2
|
|
165
|
|
166 * Exit routine
|
|
167
|
|
168 Done clrb
|
|
169 Error os9 F$Exit
|
|
170
|
|
171 Win1 pshs x
|
|
172 bsr Prepare
|
|
173 leax W1,pcr
|
|
174 bra SendOut
|
|
175
|
|
176 Win2 pshs x
|
|
177 bsr Prepare
|
|
178 leax W2,pcr
|
|
179 bra SendOut
|
|
180
|
|
181 Win5 pshs x
|
|
182 bsr Prepare
|
|
183 leax W5,pcr
|
|
184 bra SendOut
|
|
185
|
|
186 Win6 pshs x
|
|
187 bsr Prepare
|
|
188 leax W6,pcr
|
|
189 bra SendOut
|
|
190
|
|
191 Win7 pshs x
|
|
192 bsr Prepare
|
|
193 leax W7,pcr
|
|
194 bra SendOut
|
|
195
|
|
196 Win8 pshs x
|
|
197 bsr Prepare
|
|
198 leax W8,pcr
|
|
199 bra SendOut
|
|
200
|
|
201 Prepare bsr GetColor
|
|
202 lda #1
|
|
203 rts
|
|
204
|
|
205 SendOut ldy #9
|
|
206 os9 I$Write
|
|
207 bcs Error
|
|
208 ldy #3
|
|
209 leax Colors,u
|
|
210 os9 I$Write
|
|
211 bcs Error
|
|
212 leax Select,pcr
|
|
213 ldy #2
|
|
214 os9 I$Write
|
|
215 bcs Error
|
|
216 puls x
|
|
217 lbra Parse2
|
|
218
|
|
219 GetColor ldb #$96
|
|
220 clra
|
|
221 os9 I$GetStt
|
|
222 bcs Error
|
|
223 sta Colors,u
|
|
224 stx Colors+1,u
|
|
225 stb Colors+1,u
|
|
226 rts
|
|
227
|
|
228 Fast pshs x
|
1260
|
229 clr $FFD9
|
0
|
230 leax Fastmess,pcr
|
|
231 bra SpeedM
|
|
232
|
|
233 Slow pshs x
|
1260
|
234 clr $FFD8
|
0
|
235 leax Slowmess,pcr
|
|
236
|
|
237 SpeedM ldy #32
|
|
238 lda #1
|
|
239 os9 I$Write
|
|
240 lbcs Error
|
|
241 puls x
|
|
242 lbra Parse2
|
|
243
|
|
244 Query pshs x
|
|
245 leax CR,pcr
|
|
246 lda #1
|
|
247 ldy #1
|
|
248 os9 I$Write
|
|
249 lbcs Error
|
|
250
|
|
251 WinType lda #1
|
|
252 ldb #$93
|
|
253 os9 I$GetStt
|
|
254 bcc Compare
|
|
255 cmpb #208
|
|
256 lbne Error
|
|
257 leax VDG,pcr
|
|
258 bra WriteIt
|
|
259
|
|
260 Compare cmpa #1
|
|
261 beq T1
|
|
262 cmpa #2
|
|
263 beq T2
|
|
264 cmpa #5
|
|
265 beq T5
|
|
266 cmpa #6
|
|
267 beq T6
|
|
268 cmpa #7
|
|
269 beq T7
|
|
270
|
|
271 T8 leax Type8,pcr
|
|
272 bra WriteIt
|
|
273 T1 leax Type1,pcr
|
|
274 bra WriteIt
|
|
275 T2 leax Type2,pcr
|
|
276 bra WriteIt
|
|
277 T5 leax Type5,pcr
|
|
278 bra WriteIt
|
|
279 T6 leax Type6,pcr
|
|
280 bra WriteIt
|
|
281 T7 leax Type7,pcr
|
|
282
|
|
283 WriteIt lda #1
|
|
284 ldy #50
|
|
285 os9 I$WritLn
|
|
286 lbcs Error
|
|
287 puls X
|
|
288 lbra Parse2
|
|
289
|
|
290 emod
|
|
291 Size equ *
|
|
292 end
|
1260
|
293
|