1881
|
1 ********************************************************************
|
|
2 * WordPakII - Word-Pak II Driver
|
|
3 *
|
|
4 * $Id$
|
|
5 *
|
|
6 * NOTE: This driver is currently a stand-alone SCF driver. Work has
|
|
7 * started to convert it into a co-module that would fit under the
|
|
8 * CCIO driver hierarchy, but that work is not complete.
|
|
9 *
|
|
10 * Edt/Rev YYYY/MM/DD Modified by
|
|
11 * Comment
|
|
12 * ------------------------------------------------------------------
|
|
13 * 5 1985?/??/??
|
|
14 * Original OS-9 Level One Driver
|
|
15
|
1739
|
16 nam WordPakII
|
1881
|
17 ttl Word-Pak II Driver
|
1739
|
18
|
|
19 * Disassembled 2005/01/06 19:47:27 by Disasm v1.5 (C) 1988 by RML
|
|
20
|
|
21 ifp1
|
|
22 use defsfile
|
1933
|
23 use vtiodefs
|
1739
|
24 endc
|
|
25
|
|
26 tylg set Drivr+Objct
|
|
27 atrv set ReEnt+rev
|
|
28 rev set $01
|
1881
|
29 edition set 5
|
1739
|
30
|
|
31 CO80 equ 0
|
|
32 SIZEX equ 80
|
|
33 SIZEY equ 24
|
|
34
|
|
35 mod eom,name,tylg,atrv,start,size
|
|
36 rmb $1D
|
|
37 V.PIA rmb 2
|
|
38 rmb $BB-$1D-2
|
|
39 size equ .
|
|
40
|
|
41 fcb $07
|
|
42
|
|
43 name
|
|
44 IFEQ CO80
|
|
45 fcs /WordPakII/
|
|
46 ELSE
|
|
47 fcs /CO80/
|
|
48 ENDC
|
1881
|
49 fcb edition
|
1739
|
50
|
1881
|
51 * fcc /(C) 1985 PBJ, Inc./
|
1739
|
52
|
|
53 * WordPak Initialization Values
|
|
54 WPIV fcb $6E R0
|
|
55 fcb $50 R1
|
|
56 fcb $56 R2
|
|
57 fcb $18 R3
|
|
58 fcb $1A R4
|
|
59 fcb $00 R5
|
|
60 fcb $18 R6
|
|
61 fcb $19 R7
|
|
62 fcb $78 R8
|
|
63 fcb $09 R9
|
1881
|
64 L0034 fcb $60 R10
|
1739
|
65 fcb $09 R11
|
|
66 fcb $00 R12
|
|
67 fcb $00 R13
|
|
68 fcb $00 R14
|
|
69 fcb $00 R15
|
|
70 fcb $00 R16
|
|
71 fcb $00 R17
|
|
72 fcb $00 R18
|
|
73 fcb $00 R19
|
|
74 fcb $10 R20
|
|
75
|
1741
|
76 start bra Init
|
1739
|
77 nop
|
|
78 IFEQ CO80
|
1741
|
79 lbra Read
|
1739
|
80 ENDC
|
1741
|
81 lbra Write
|
|
82 bra GetStat
|
1739
|
83 nop
|
1741
|
84 lbra SetStat
|
1739
|
85 IFEQ CO80
|
1741
|
86 lbra Term
|
1739
|
87 ELSE
|
|
88 rts
|
|
89 ENDC
|
|
90
|
1741
|
91 Init
|
1739
|
92 IFEQ CO80
|
|
93 pshs dp,cc save DP and CC
|
|
94 orcc #IntMasks mask interrupts
|
|
95 clra
|
|
96 tfr a,dp set DP to 0
|
|
97 stu <D.KbdSta save off statics ptr
|
|
98 nop
|
|
99 nop
|
|
100 nop
|
|
101 nop
|
|
102 leax >IRQSVC,pcr point to IRQ routine
|
|
103 stx <D.AltIRQ save as alternate IRQ
|
|
104 ldx #PIA0Base get base address of PIA0
|
|
105 stx <V.PIA,u save off in statics
|
|
106 clrb now D = 0
|
|
107 std <$27,u
|
|
108 std <$29,u
|
|
109 std <$2B,u
|
|
110 std <$2D,u
|
|
111 * Initialize PIA here
|
|
112 sta $01,x
|
|
113 sta ,x
|
|
114 sta $03,x
|
|
115 comb B = $FF
|
|
116 stb $02,x
|
|
117 stb <$20,u
|
|
118 stb <$21,u
|
|
119 stb <$22,u
|
|
120 lda #$34
|
|
121 sta $01,x
|
|
122 lda #$3F
|
|
123 sta $03,x
|
|
124 lda $02,x
|
|
125 ENDC
|
|
126 * Initialize WordPak Hardware
|
|
127 clra
|
|
128 leax <WPIV,pcr point to initialization values
|
|
129 L0097 ldb ,x+
|
|
130 std [<V.PORT,u] write to WP hardware
|
|
131 inca
|
|
132 cmpa #$14
|
|
133 bcs L0097
|
|
134 IFEQ CO80
|
|
135 ldb ,x
|
|
136 stb <$31,u
|
|
137 ldx V.PORT,u get port address
|
|
138 lda #64
|
|
139 sta $04,x ???
|
|
140 lbsr ClrScr clear screen
|
|
141 lda <L0034,pcr
|
|
142 sta <$3A,u
|
|
143 puls pc,dp,cc
|
|
144 ELSE
|
|
145 rts
|
|
146 ENDC
|
|
147
|
|
148
|
1741
|
149 GetStat
|
1739
|
150 IFEQ CO80
|
|
151 cmpa #SS.Ready
|
|
152 bne L00C9
|
|
153 lda <$2E,u
|
|
154 suba <$2D,u
|
|
155 lbne L0181
|
|
156 ldb #E$NotRdy
|
|
157 bra L00F5
|
|
158 L00C9 cmpa #SS.EOF
|
|
159 lbeq L0181
|
|
160 ldx R$Y,y
|
|
161 cmpa #SS.Joy
|
1741
|
162 lbeq SSJOY
|
1739
|
163 cmpa #SS.Cursr
|
|
164 beq CURSR
|
|
165 cmpa #SS.ScSiz
|
|
166 beq SCSIZ
|
|
167 cmpa #$83
|
|
168 beq L00F8
|
|
169 cmpa #$84
|
|
170 beq L0106
|
|
171 cmpa #$86
|
|
172 beq L0117
|
|
173 cmpa #$87
|
|
174 beq L0101
|
|
175 cmpa #$88
|
|
176 beq L00FC
|
|
177 ENDC
|
1741
|
178 SetStat ldb #E$UnkSvc
|
1739
|
179 L00F5 orcc #Carry
|
|
180 rts
|
|
181 L00F8 lda #$7F
|
|
182 bra L0102
|
|
183 L00FC lda <$31,u
|
|
184 bra L0102
|
|
185 L0101 clra
|
|
186 L0102 sta $01,x
|
|
187 bra L0127
|
|
188
|
|
189 L0106 ldd #80*256+24
|
|
190 bra L0125
|
|
191
|
|
192 SCSIZ ldd #SIZEX
|
|
193 std R$X,x
|
|
194 ldd #SIZEY
|
|
195 std R$Y,x
|
|
196 bra L0127
|
|
197
|
|
198 L0117 ldb <$3A,u
|
|
199 bsr L0129
|
|
200 andb #$0F
|
|
201 bne L0124
|
|
202 ldb #$01
|
|
203 bra L0125
|
|
204 L0124 clrb
|
|
205 L0125 std R$A,x
|
|
206 L0127 clrb
|
|
207 rts
|
|
208 L0129 pshs x,b
|
|
209 clra
|
|
210 leax >L083C,pcr
|
|
211 andb #$60
|
|
212 L0132 cmpb ,x+
|
|
213 beq L013B
|
|
214 inca
|
|
215 cmpa #$03
|
|
216 bcs L0132
|
|
217 L013B puls x,b
|
|
218 rts
|
|
219
|
|
220 CURSR clrb
|
|
221 pshs b
|
|
222 ldd <$34,u
|
|
223 L0144 cmpd <$32,u
|
|
224 beq L0151
|
|
225 subd #SIZEX
|
|
226 inc ,s
|
|
227 bra L0144
|
|
228 L0151 puls b
|
|
229 addb #$20
|
|
230 clra
|
|
231 std $06,x
|
|
232 ldd <$36,u
|
|
233 subd <$34,u
|
|
234 addb #$20
|
|
235 clra
|
|
236 std $04,x
|
|
237 lbsr L05C2
|
|
238 anda #$7F
|
|
239 sta $01,x
|
|
240 ldx <$36,u
|
|
241 lbra L056A
|
|
242
|
|
243 IFEQ CO80
|
1741
|
244 Term pshs cc
|
1739
|
245 orcc #IRQMask
|
|
246 ldd >D.Clock get original clock pointer
|
|
247 std >D.AltIRQ save as alternate IRQ
|
|
248 puls pc,cc
|
|
249
|
|
250 L017C incb
|
|
251 cmpb #$7F
|
|
252 bls L0182
|
|
253 L0181 clrb
|
|
254 L0182 rts
|
|
255
|
|
256 * Interrupt Service Routine
|
|
257 IRQSVC ldu >D.KbdSta get IRQ static ptr in U
|
|
258 ldx <V.PIA,u
|
|
259 lda $03,x get IRQ status bit
|
|
260 bmi L0191 branch if set
|
|
261 jmp [>D.AltIRQ] else continue on
|
|
262 L0191 lda $02,x
|
|
263 lda #$FF
|
|
264 sta $02,x
|
|
265 lda ,x
|
|
266 coma
|
|
267 anda #$03
|
|
268 bne L01A7
|
|
269 clr $02,x
|
|
270 lda ,x
|
|
271 coma
|
|
272 anda #$7F
|
|
273 bne L01C8
|
|
274 L01A7 ldd #$FFFF
|
|
275 std <$20,u
|
|
276 std <$22,u
|
|
277 L01B0 ldd #$1E05
|
|
278 std <$2F,u
|
|
279 L01B6 lda >$00A0
|
|
280 beq L01C4
|
|
281 deca
|
|
282 sta >$00A0
|
|
283 bne L01C4
|
|
284 sta >$FF40
|
|
285 L01C4 jmp [>D.Clock]
|
|
286 L01C8 bsr L0217
|
|
287 bpl L01D0
|
|
288 bcs L01B6
|
|
289 bra L01B0
|
|
290 L01D0 cmpa #$1F
|
|
291 bne L01D9
|
|
292 com <$27,u
|
|
293 bra L01B6
|
|
294 L01D9 ldb <$2D,u
|
|
295 leax <$3B,u
|
|
296 abx
|
|
297 bsr L017C
|
|
298 cmpb <$2E,u
|
|
299 beq L01EA
|
|
300 stb <$2D,u
|
|
301 L01EA sta ,x
|
|
302 beq L020A
|
|
303 cmpa V.PCHR,u pause character?
|
|
304 bne L01FA
|
|
305 ldx V.DEV2,u
|
|
306 beq L020A
|
|
307 sta $08,x
|
|
308 bra L020A
|
|
309 L01FA ldb #S$Intrpt
|
|
310 cmpa V.INTR,u interrupt character?
|
|
311 beq L0206
|
|
312 ldb #S$Abort
|
|
313 cmpa V.QUIT,u quit character?
|
|
314 bne L020A
|
|
315 L0206 lda V.LPRC,u
|
|
316 bra L020E
|
|
317 L020A ldb #S$Wake
|
|
318 lda V.WAKE,u
|
|
319 L020E beq L0213
|
|
320 os9 F$Send
|
|
321 L0213 clr V.WAKE,u
|
|
322 bra L01B6
|
|
323 L0217 clra
|
|
324 clrb
|
|
325 sta <$1F,u
|
|
326 std <$28,u
|
|
327 coma
|
|
328 sta <$24,u
|
|
329 sta <$25,u
|
|
330 sta <$26,u
|
|
331 deca
|
|
332 sta $02,x
|
|
333 L022C lda ,x
|
|
334 coma
|
|
335 anda #$7F
|
|
336 beq L023F
|
|
337 ldb #$FF
|
|
338 L0235 incb
|
|
339 lsra
|
|
340 bcc L023B
|
|
341 bsr L0286
|
|
342 L023B cmpb #$06
|
|
343 bcs L0235
|
|
344 L023F inc <$1F,u
|
|
345 orcc #Carry
|
|
346 rol $02,x
|
|
347 bcs L022C
|
|
348 bsr L02C1
|
|
349 bmi L0285
|
|
350 beq L0268
|
|
351 suba #$1A
|
|
352 bhi L0268
|
|
353 adda #$1A
|
|
354 ldb <$29,u
|
|
355 bne L0267
|
|
356 adda #$40
|
|
357 ldb <$28,u
|
|
358 eorb <$27,u
|
|
359 andb #$01
|
|
360 bne L0267
|
|
361 adda #$20
|
|
362 L0267 rts
|
|
363 L0268 ldb #$03
|
|
364 mul
|
|
365 lda <$28,u
|
|
366 beq L0273
|
|
367 incb
|
|
368 bra L027A
|
|
369 L0273 lda <$29,u
|
|
370 beq L027A
|
|
371 addb #$02
|
|
372 L027A pshs x
|
|
373 leax >L0344,pcr
|
|
374 clra
|
|
375 lda d,x
|
|
376 puls x
|
|
377 L0285 rts
|
|
378
|
|
379 L0286 pshs b
|
|
380 lslb
|
|
381 lslb
|
|
382 lslb
|
|
383 addb <$1F,u
|
|
384 cmpb #$31
|
|
385 bne L0297
|
|
386 inc <$29,u
|
|
387 puls pc,b
|
|
388 L0297 cmpb #$37
|
|
389 bne L02A0
|
|
390 com <$28,u
|
|
391 puls pc,b
|
|
392 L02A0 pshs x
|
|
393 leax <$24,u
|
|
394 bsr L02AB
|
|
395 puls x
|
|
396 puls pc,b
|
|
397 L02AB pshs a
|
|
398 lda ,x
|
|
399 bpl L02B5
|
|
400 stb ,x
|
|
401 puls pc,a
|
|
402 L02B5 lda $01,x
|
|
403 bpl L02BD
|
|
404 stb $01,x
|
|
405 puls pc,a
|
|
406 L02BD stb $02,x
|
|
407 puls pc,a
|
|
408 L02C1 pshs y,x,b
|
|
409 leax <$20,u
|
|
410 ldb #$03
|
|
411 pshs b
|
|
412 L02CA leay <$24,u
|
|
413 ldb #$03
|
|
414 lda ,x
|
|
415 bmi L0322
|
|
416 L02D3 cmpa ,y
|
|
417 bne L0319
|
|
418 tst <$23,u
|
|
419 bpl L02EB
|
|
420 sta <$23,u
|
|
421 pshs b
|
|
422 ldd #$1E05
|
|
423 std <$2F,u
|
|
424 puls b
|
|
425 bra L0301
|
|
426 L02EB cmpa <$23,u
|
|
427 beq L02F9
|
|
428 sta <$23,u
|
|
429 ldd #$1E05
|
|
430 std <$2F,u
|
|
431 L02F9 tst <$2F,u
|
|
432 beq L0307
|
|
433 dec <$2F,u
|
|
434 L0301 clr ,y
|
|
435 com ,y
|
|
436 bra L0322
|
|
437 L0307 dec <$30,u
|
|
438 beq L0312
|
|
439 orcc #Negative+Carry
|
|
440 L030E leas $01,s
|
|
441 puls pc,y,x,b
|
|
442 L0312 ldb #$05
|
|
443 stb <$30,u
|
|
444 bra L030E
|
|
445 L0319 leay $01,y
|
|
446 decb
|
|
447 bne L02D3
|
|
448 lda #$FF
|
|
449 sta ,x
|
|
450 L0322 leax $01,x
|
|
451 dec ,s
|
|
452 bne L02CA
|
|
453 leas $01,s
|
|
454 leax <$24,u
|
|
455 lda #$03
|
|
456 L032F ldb ,x+
|
|
457 bpl L033A
|
|
458 deca
|
|
459 bne L032F
|
|
460 orcc #Negative
|
|
461 puls pc,y,x,b
|
|
462 L033A leax <$20,u
|
|
463 lbsr L02AB
|
|
464 tfr b,a
|
|
465 puls pc,y,x,b
|
|
466 ENDC
|
|
467
|
|
468 L0344 fdb $4060,$000c,$1c13,$0a1a,$1208,$1810
|
|
469 fdb $0919,$1120,$2020,$3030,$1f31,$217c,$3222,$0033
|
|
470 fdb $237e,$3424,$0035,$2500,$3626,$0037,$275e,$3828
|
|
471 fdb $5b39,$295d,$3a2a,$003b,$2b00,$2c3c,$7b2d,$3d5f
|
|
472 fdb $2e3e,$7d2f,$3f5c,$0d0d,$0d00,$0000,$0503
|
|
473 fcb $1b
|
|
474
|
|
475 IFEQ CO80
|
1741
|
476 Read leax <$3B,u
|
1739
|
477 ldb <$2E,u
|
|
478 orcc #IntMasks
|
|
479 cmpb <$2D,u
|
|
480 beq L03A8
|
|
481 abx
|
|
482 lda ,x
|
|
483 lbsr L017C
|
|
484 stb <$2E,u
|
|
485 andcc #^(IntMasks+Carry)
|
|
486 rts
|
|
487 L03A8 lda V.BUSY,u
|
|
488 sta V.WAKE,u
|
|
489 andcc #^IntMasks
|
|
490 ldx #$0000
|
|
491 os9 F$Sleep
|
|
492 clr V.WAKE,u
|
|
493 ldx >D.Proc
|
|
494 ldb <$36,x
|
1741
|
495 beq Read
|
1739
|
496 cmpb #$03
|
1741
|
497 L03C0 bhi Read
|
1739
|
498 coma
|
|
499 rts
|
|
500 ENDC
|
|
501
|
1741
|
502 SSJOY pshs u,y,cc
|
1739
|
503 orcc #IntMasks
|
1741
|
504 ldu <V.PIA,u get PIA address
|
1739
|
505 lda #$FF
|
|
506 sta $02,u
|
|
507 ldb ,u
|
|
508 L03D1 ldy $04,x
|
|
509 beq L03DC
|
|
510 andb #$02
|
|
511 beq L03E1
|
|
512 bra L03E0
|
|
513 L03DC andb #$01
|
|
514 beq L03E1
|
|
515 L03E0 clra
|
|
516 L03E1 sta $01,x
|
|
517 lda $03,u
|
|
518 ora #$08
|
|
519 ldy $04,x
|
|
520 bne L03EE
|
|
521 anda #$F7
|
|
522 L03EE sta >$FF03
|
|
523 lda $01,u
|
|
524 anda #$F7
|
|
525 bsr L040B
|
|
526 std $04,x
|
|
527 lda $01,u
|
|
528 ora #$08
|
|
529 bsr L040B
|
|
530 pshs b,a
|
|
531 ldd #$003F
|
|
532 subd ,s++
|
|
533 std $06,x
|
|
534 clrb
|
|
535 puls pc,u,y,cc
|
1741
|
536
|
1739
|
537 L040B sta $01,u
|
|
538 clrb
|
|
539 bsr L041A
|
|
540 bsr L041A
|
|
541 bsr L041A
|
|
542 bsr L041A
|
|
543 lsrb
|
|
544 lsrb
|
|
545 clra
|
|
546 rts
|
1741
|
547
|
1739
|
548 L041A pshs b
|
|
549 lda #$7F
|
|
550 tfr a,b
|
|
551 L0420 lsrb
|
|
552 cmpb #$03
|
|
553 bhi L042C
|
|
554 lsra
|
|
555 lsra
|
|
556 tfr a,b
|
|
557 addb ,s+
|
|
558 rts
|
1741
|
559
|
1739
|
560 L042C addb #$02
|
|
561 andb #$FC
|
|
562 pshs b
|
|
563 sta >PIA1Base
|
|
564 tst ,u
|
|
565 bpl L043D
|
|
566 adda ,s+
|
|
567 bra L0420
|
|
568 L043D suba ,s+
|
|
569 bra L0420
|
|
570
|
|
571 L0441 fcb $02
|
|
572 fdb ClrScr-* $0276
|
|
573 fcb $05
|
|
574 fdb Do05-* $0258
|
|
575 fcb $06
|
|
576 fdb Do06-* $03b3
|
|
577 fcb $09
|
|
578 fdb Do09-* $0222
|
|
579 fcb $0b
|
|
580 fdb Do0B-* $0209
|
|
581 fcb $0F
|
|
582 fdb Do0F-* $01fe
|
|
583 fcb $13
|
|
584 fdb Do13-* $0283
|
|
585 fcb $14
|
|
586 fdb Do14-* $0339
|
|
587 fcb $19
|
|
588 fdb Do19-* $023f
|
|
589 fcb $1b
|
|
590 fdb DoESC-* $0095
|
|
591 fcb $80
|
|
592
|
|
593 L0460 fcb $01
|
|
594 fdb DoH01-* $01ee
|
|
595 fcb $02
|
|
596 fdb DoH02-* $032c
|
|
597 fcb $03
|
|
598 fdb DoH03-* $0232
|
|
599 fcb $04
|
|
600 fdb DoH04-* $0233
|
|
601 fcb $05
|
|
602 fdb DoH05-* $008c
|
|
603 fcb $06
|
|
604 fdb DoH06-* $01fd
|
|
605 fcb $09
|
|
606 fdb DoH09-* $01e4
|
|
607 fcb $0b
|
|
608 fdb DoH0B-* $0261
|
|
609 fcb $0c
|
|
610 fdb ClrScr-* $023f
|
|
611 fcb $1b
|
|
612 fdb DoESC-* $0076
|
|
613 fcb $80
|
|
614
|
|
615 L047F fcb $41
|
|
616 fdb Do41-* $021d
|
|
617 fcb $42
|
|
618 fdb Do42-* $0254
|
|
619 fcb $45
|
|
620 fdb Do45-* $02c2
|
|
621 fcb $46
|
|
622 fdb Do46-* $02e5
|
|
623 fcb $47
|
|
624 fdb Do47-* $0287
|
|
625 fcb $48
|
|
626 fdb Do48-* $0264
|
|
627 fcb $53
|
|
628 fdb Do53-* $0058
|
|
629 fcb $56
|
|
630 fdb Do56-* $037f
|
|
631 fcb $58
|
|
632 fdb Do58-* $0056
|
|
633 fcb $57
|
|
634 fdb Do57-* $004b
|
|
635 fcb $76
|
|
636 fdb Do76-* $037d
|
|
637 fcb $80
|
|
638
|
1741
|
639 Write
|
1739
|
640 IFEQ CO80
|
|
641 fcb $6D,$C8,$2C
|
|
642 lbne L079C
|
|
643 ldx <$36,u
|
|
644 tst <$2A,u
|
|
645 bne L04FD
|
|
646 ENDC
|
|
647 cmpa #C$SPAC space?
|
|
648 lbcc L053A branch if >=
|
|
649 cmpa #C$CR carriage return?
|
|
650 lbeq L0557 branch if equal
|
|
651 cmpa #C$LF line feed?
|
|
652 lbeq L055C branch if equal
|
|
653 cmpa #C$BSP backspace?
|
|
654 lbeq L056A branch if equal
|
|
655 tst V.TYPE,u look at type
|
|
656 bmi L04D2 branch if hi-bit set
|
|
657 leay >L0441,pcr
|
|
658 bra L04D6
|
|
659 L04D2 leay >L0460,pcr
|
|
660 L04D6 cmpa ,y+
|
|
661 beq L04E2
|
|
662 leay $02,y
|
|
663 tst ,y
|
|
664 bpl L04D6
|
|
665 bra L0555
|
|
666 L04E2 ldd ,y
|
|
667 jmp d,y
|
|
668
|
1741
|
669 Do57 lda #$57
|
1739
|
670 bra L04F4
|
|
671
|
|
672 Do53 lda #$53
|
|
673 bra L04F4
|
|
674
|
|
675 Do58 lda #$58
|
|
676 bra L04F4
|
|
677
|
|
678 DoESC lda #$1B
|
|
679 L04F4 sta <$2A,u
|
|
680 L04F7 clrb
|
|
681 rts
|
|
682
|
|
683 DoH05
|
|
684 Do01 lda #$05
|
|
685 bra L04F4
|
|
686
|
|
687 L04FD ldb <$2A,u
|
|
688 clr <$2A,u
|
|
689 tst V.TYPE,u get type byte
|
|
690 bmi L0513 branch if hi-bit set
|
|
691 cmpb #$2E
|
|
692 lbeq L0807
|
|
693 cmpa #$2E
|
|
694 beq L04F4
|
|
695 clrb
|
|
696 rts
|
|
697
|
|
698 L0513 cmpb #$05
|
|
699 beq L04F7
|
|
700 cmpb #$57
|
|
701 lbeq L0822
|
|
702 cmpb #$53
|
|
703 lbeq L07F2
|
|
704 cmpb #$58
|
|
705 bne L0534
|
|
706 suba #$20
|
|
707 ble L0555
|
|
708 cmpa #$10
|
|
709 bhi L0555
|
|
710 sta <$31,u
|
|
711 bra L0555
|
|
712 L0534 leay >L047F,pcr
|
|
713 bra L04D6
|
|
714 L053A bsr L05A1
|
|
715 leax $01,x
|
|
716 stx <$36,u
|
|
717 bsr L058C
|
|
718 ldx <$34,u
|
|
719 leax <$50,x
|
|
720 cmpx <$36,u
|
|
721 bhi L0555
|
|
722 L054E stx <$34,u
|
|
723 bsr L05CD
|
|
724 L0553 bsr L0587
|
|
725 L0555 clrb
|
|
726 rts
|
|
727
|
|
728 L0557 ldx <$34,u
|
|
729 bra L0582
|
|
730 L055C leax <$50,x
|
|
731 stx <$36,u
|
|
732 ldx <$34,u
|
|
733 leax <$50,x
|
|
734 bra L054E
|
|
735 L056A cmpx <$34,u
|
|
736 bhi L0580
|
|
737 ldy <$34,u
|
|
738 cmpy <$32,u
|
|
739 beq L0555
|
|
740 leay <-$50,y
|
|
741 sty <$34,u
|
|
742 L0580 leax -$01,x
|
|
743 L0582 stx <$36,u
|
|
744 bra L0553
|
|
745 L0587 ldx <$36,u
|
|
746 L058A bsr L0591
|
|
747 L058C lda #$0E
|
|
748 bsr L0593
|
|
749 rts
|
|
750 L0591 lda #$12
|
|
751 L0593 pshs x
|
|
752 ldb ,s+
|
|
753 std [<V.PORT,u]
|
|
754 inca increment A
|
|
755 ldb ,s+
|
|
756 std [<V.PORT,u]
|
|
757 rts
|
|
758 L05A1 tst <$2B,u
|
|
759 beq L05AA
|
|
760 ora #$80
|
|
761 bra L05AC
|
|
762 L05AA anda #$7F
|
|
763 L05AC bsr L05B7
|
|
764 pshs x
|
|
765 ldx $01,u
|
|
766 sta $03,x
|
|
767 puls x
|
|
768 rts
|
|
769 L05B7 ldb #$1F
|
|
770 stb [<V.PORT,u]
|
|
771 L05BC tst [<V.PORT,u]
|
|
772 bpl L05BC
|
|
773 rts
|
|
774 L05C2 bsr L05B7
|
|
775 pshs x
|
|
776 ldx $01,u
|
|
777 lda $03,x
|
|
778 puls x
|
|
779 L05CC rts
|
|
780 L05CD ldd <$34,u
|
|
781 subd <$32,u
|
1741
|
782 cmpd #SIZEX*SIZEY
|
1739
|
783 bmi L05CC
|
|
784 lbsr L06AE
|
|
785 ldx <$32,u
|
|
786 leax <$50,x
|
|
787 cmpx #$5000
|
|
788 bmi L05F3
|
|
789 ldx #SIZEX*SIZEY-SIZEX
|
|
790 stx <$34,u
|
|
791 stx <$36,u
|
|
792 ldx #$0000
|
|
793 L05F3 stx <$32,u
|
|
794 ldy $01,u
|
|
795 leay $04,y
|
|
796 ldb <$31,u
|
|
797 cmpb #$10
|
|
798 beq L062A
|
|
799 negb
|
|
800 andb #$0F
|
|
801 lda #$C0
|
|
802 L0607 pshs b
|
|
803 pshs b
|
|
804 ldb #$20
|
|
805 inca
|
|
806 cmpa #$CA
|
|
807 beq L0628
|
|
808 L0612 bitb [<V.PORT,u]
|
|
809 bne L0612
|
|
810 L0617 bitb [<V.PORT,u]
|
|
811 beq L0617
|
|
812 sta ,y
|
|
813 dec ,s
|
|
814 bne L0612
|
|
815 puls b
|
|
816 puls b
|
|
817 bra L0607
|
|
818 L0628 leas $02,s
|
|
819 L062A tfr x,d
|
|
820 tfr a,b
|
|
821 lda #$0C
|
|
822 pshs b,a
|
|
823 tfr x,d
|
|
824 lda #$0D
|
|
825 pshs b,a
|
|
826 ldb #$20
|
|
827 L063A bitb [<V.PORT,u]
|
|
828 beq L063A
|
|
829 puls x,b,a
|
|
830 stx [<V.PORT,u]
|
|
831 std [<V.PORT,u]
|
|
832 lda #$40
|
|
833 sta ,y
|
|
834 lbsr L0587
|
|
835 rts
|
|
836
|
|
837
|
|
838 DoH01
|
1741
|
839 Do0F ldx <$32,u
|
1739
|
840 stx <$34,u
|
|
841 bra L0693
|
|
842
|
|
843 DoH09
|
1741
|
844 Do0B ldx <$34,u
|
1739
|
845 cmpx <$32,u
|
|
846 bls L0696
|
|
847 leax <-$50,x
|
|
848 stx <$34,u
|
|
849 ldx <$36,u
|
|
850 leax <-$50,x
|
|
851 bra L0693
|
|
852
|
|
853 DoH06
|
1741
|
854 Do09 ldd <$34,u
|
1739
|
855 addd #SIZEX-1
|
|
856 cmpd <$36,u
|
|
857 bhi L068E
|
|
858 ldx <$32,u
|
|
859 leax >SIZEX*SIZEY-SIZEX,x
|
|
860 cmpx <$34,u
|
|
861 beq L0696
|
|
862 ldx <$34,u
|
|
863 leax <$50,x
|
|
864 stx <$34,u
|
|
865 L068E ldx <$36,u
|
|
866 leax $01,x
|
|
867 L0693 stx <$36,u
|
|
868 L0696 lbra L0553
|
|
869
|
|
870 DoH03
|
|
871 Do19
|
|
872 bsr L06AE
|
|
873 clrb
|
|
874 rts
|
|
875
|
|
876 Do41
|
|
877 DoH04
|
1741
|
878 Do05 bsr L06A1
|
1739
|
879 clrb
|
|
880 rts
|
|
881 L06A1 ldd <$34,u
|
|
882 addd #SIZEX
|
|
883 subd <$36,u
|
|
884 tfr d,y
|
|
885 bra L06B5
|
|
886 L06AE ldx <$34,u
|
|
887 ldy #SIZEX
|
|
888 L06B5 lbra L0768
|
|
889 Do02
|
|
890 ClrScr ldx <$32,u
|
|
891 ldy #2048
|
|
892 bsr L06E6
|
|
893 ldx #$0000
|
|
894 stx <$32,u
|
|
895 stx <$34,u
|
|
896 stx <$36,u
|
|
897 lda #$0C
|
|
898 lbsr L0593
|
|
899 lbsr L058A
|
|
900 clrb
|
|
901 rts
|
|
902
|
|
903 Do42
|
|
904 DoH0B
|
|
905 Do13
|
|
906 ldd <$32,u
|
|
907 addd #2048
|
|
908 subd <$36,u
|
|
909 tfr d,y
|
|
910 bsr L06E6
|
|
911 bra L0696
|
|
912 L06E6 lbsr L0591
|
|
913 L06E9 lda #$20
|
|
914 L06EB lbsr L05A1
|
|
915 leay -$01,y
|
|
916 bne L06EB
|
|
917 rts
|
|
918
|
1741
|
919 Do48 ldx <$34,u
|
1739
|
920 tfr x,y
|
|
921 leax <$4F,x
|
|
922 pshs x
|
|
923 L06FD leax $08,y
|
|
924 bsr L0733
|
|
925 cmpx ,s
|
|
926 bcc L0709
|
|
927 leay $01,y
|
|
928 bra L06FD
|
|
929 L0709 leas $02,s
|
|
930 ldy #$0008
|
|
931 bsr L06E9
|
|
932 bra L0696
|
|
933
|
1741
|
934 Do47 ldy <$34,u
|
1739
|
935 leay <$4F,y
|
|
936 L071A leax -$08,y
|
|
937 bsr L0733
|
|
938 cmpx <$34,u
|
|
939 bls L0727
|
|
940 leay -$01,y
|
|
941 bra L071A
|
|
942 L0727 ldx <$34,u
|
|
943 ldy #$0008
|
|
944 bsr L06E6
|
|
945 lbra L0553
|
|
946 L0733 lbsr L0591
|
|
947 lbsr L05C2
|
|
948 pshs a
|
|
949 exg x,y
|
|
950 lbsr L0591
|
|
951 puls a
|
|
952 lbsr L05AC
|
|
953 exg x,y
|
|
954 rts
|
|
955
|
|
956 Do45 ldy <$32,u
|
|
957 leay >$077F,y
|
|
958 L0750 leax <-$50,y
|
|
959 bsr L0733
|
|
960 cmpx <$34,u
|
|
961 bls L075E
|
|
962 leay -$01,y
|
|
963 bra L0750
|
|
964 L075E ldx <$34,u
|
|
965 stx <$36,u
|
|
966 L0764 ldy #SIZEX
|
|
967 L0768 lbsr L06E6
|
|
968 lbra L0553
|
|
969
|
|
970 Do46 ldy <$32,u
|
|
971 leay >SIZEX*SIZEY-SIZEX,y
|
|
972 pshs y
|
|
973 ldy <$34,u
|
|
974 L077C leax <$50,y
|
|
975 bsr L0733
|
|
976 cmpy ,s
|
|
977 bcc L078A
|
|
978 leay $01,y
|
|
979 bra L077C
|
|
980 L078A leas $02,s
|
|
981 tfr y,x
|
|
982 bra L0764
|
|
983
|
|
984 DoH02
|
|
985 Do14
|
|
986 ldb #$58
|
|
987 tst V.TYPE,u
|
|
988 bmi L0797
|
|
989 incb
|
|
990 L0797 stb <$2C,u
|
|
991 clrb
|
|
992 rts
|
|
993
|
|
994 L079C suba #$20
|
|
995 ldb <$2C,u
|
|
996 tst V.TYPE,u
|
|
997 bpl L07B1
|
|
998 cmpb #$58
|
|
999 bne L07AD
|
|
1000 bsr L07C6
|
|
1001 bra L07F0
|
|
1002 L07AD bsr L07B9
|
|
1003 bra L07D5
|
|
1004 L07B1 cmpb #$59
|
|
1005 bne L07D3
|
|
1006 bsr L07B9
|
|
1007 bra L07F0
|
|
1008 L07B9 cmpa #$17
|
|
1009 bls L07BF
|
|
1010 lda #$17
|
|
1011 L07BF sta <$38,u
|
|
1012 dec <$2C,u
|
|
1013 rts
|
|
1014 L07C6 cmpa #$4F
|
|
1015 bls L07CC
|
|
1016 lda #$4F
|
|
1017 L07CC sta <$39,u
|
|
1018 inc <$2C,u
|
|
1019 rts
|
|
1020 L07D3 bsr L07C6
|
|
1021 L07D5 lda <$38,u
|
1741
|
1022 ldb #SIZEX
|
1739
|
1023 mul
|
|
1024 ldx <$32,u
|
|
1025 leax d,x
|
|
1026 stx <$34,u
|
|
1027 ldb <$39,u
|
|
1028 abx
|
|
1029 stx <$36,u
|
|
1030 lbsr L0587
|
|
1031 clr <$2C,u
|
|
1032 L07F0 clrb
|
|
1033 rts
|
|
1034 L07F2 suba #$20
|
|
1035 beq L0802
|
|
1036 deca
|
|
1037 beq L0801
|
|
1038 bra L0805
|
|
1039
|
|
1040 Do06 clra
|
|
1041 tst <$2B,u
|
|
1042 bne L0802
|
|
1043 L0801 coma
|
|
1044 L0802 sta <$2B,u
|
|
1045 L0805 clrb
|
|
1046 rts
|
|
1047
|
|
1048 L0807 suba #$30
|
|
1049 cmpa #$04
|
|
1050 bhi L083A
|
|
1051 leax <L083F,pcr
|
|
1052 ldb a,x
|
|
1053 bra L0832
|
|
1054
|
|
1055 Do56 ldb #$F0
|
|
1056 andb <$3A,u
|
|
1057 bra L0832
|
|
1058
|
|
1059 Do76 ldb #$08
|
|
1060 orb <$3A,u
|
|
1061 bra L0832
|
|
1062 L0822 suba #$20
|
|
1063 cmpa #$03
|
|
1064 bhi L083A
|
|
1065 leax <L083C,pcr
|
|
1066 ldb <$3A,u
|
|
1067 andb #$9F
|
|
1068 orb a,x
|
|
1069 L0832 stb <$3A,u
|
|
1070 lda #$0A
|
|
1071 std [<V.PORT,u]
|
|
1072 L083A clrb
|
|
1073 rts
|
|
1074
|
|
1075 L083C neg <$60
|
|
1076 nega
|
|
1077 L083F fcb $20,$60,$00,$68,$08
|
|
1078
|
|
1079 emod
|
|
1080 eom equ *
|
|
1081 end
|