-
Notifications
You must be signed in to change notification settings - Fork 4
/
T12REV3.SRC
executable file
·2001 lines (1910 loc) · 33.1 KB
/
T12REV3.SRC
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
NAM F000 TEST ROM FOR 'JOUST' INCLUDING AUDITING AND ADJUSTMENTS
INCLUDE RAMDEF.SRC
INCLUDE EQU.SRC
INCLUDE MESSEQU.SRC
INCLUDE MESSEQU2.SRC
SETDP $A0
ORG TSTORG
PWRUPV JMP PWRUP
JMP ADVSW$
JMP AUTCYC
JMP JNAP
JMP RAND
JMP TEST
JMP CYCLE
*COLOR RAM TABLE
*
CRTAB FCB 0 0 SPACED OUT
FCB $F9 1 LASER (SPECIAL)
FCB $07 2 RED
FCB $28 3 GREEN
FCB $2F 4 YELLOW
FCB $00 5 MESSAGES
FCB $A4 6 GRAY
FCB $15 7 TERRAIN
FCB $C7 8 PURPLE
FCB $FF 9 WHITE
FCB $38 A BOMB CYCLER
FCB $17 B ORANGE
FCB $CC C CYCLER
FCB $81 D TIE1
FCB $81 E TIE2
FCB $2F F TIE3,MONO
*
*** POWER UP ROUTINE
*
PWRUP ORCC #$FF NO INTERRUPTS ETC.
LDS #HSTK IF AND WHEN WE DECIDE TO USE THE STACK
CLR PIA0+1
CLR PIA0
LDA #$3C SET LED 3 TO 1 (WE'RE MAKING AN F TO BLANK)
STA PIA0+1
CLR PIA1+1
LDA #$C0 BITS 6,7 TO OUTPUTS (LEDS)
STA PIA1
LDA #$3C SET BIT 2 TO 1
STA PIA1+1 CLEAR CB2 (LED)
LDA #$C0 CLEAR LEDS
STA PIA1 SET BITS 0,1
LDA #1
STA RWCNTL MAKE SURE WE COPY FROM ROM!
LDX #CRTAB
LDY #CRAM
PWRUP0 LDD ,X++
STD ,Y++
CMPX #CRTAB+16
BLO PWRUP0
LDA #2
LDY #PWRUP1
LDX #0
BRA RAMTST DO A RAM TEST.
PWRUP1 LDY #PWRUP4
JMP ROMTST
PWRUP4 LDA #$34 PUT A ZERO IN THE LED.
STA PIA0+1
STA PIA1+1
CLR PIA1
LDA #RAM!>8
TFR A,DP
LDS #HSTK
JSR SCCLR
LDA #MSIND INITIAL TESTS INDICATE
LDX #$3070
LDB #$99
JSR OUTPHR
LDA #MSALL ALL SYSTEMS GO
LDX #$3A90
LDB #$99
JSR OUTPHR INDICATE OK
LDY #CKCMSV DELAY TO JUMP INTO GAME.
LDA #7
JMP DELA1
*
* RAM TEST....Y = PLACE TO RETURN IF NO ERROR
* X = SEED TO START WITH
* A = ITERATIONS TO MAKE
RAMTST ORCC #$3F NO INTERRUPTS DURING TEST
CLR RWCNTL SET TO RAM READ
TFR A,DP COUNT AT DP.
TFR X,D START WITH A PASSED SEED.
RAM2 TFR D,U SAVE THE SEED
RAM0 LDX #0 MEMORY POINTER
RAM3 COMB DONT ASK
BITB #9
BNE RAM4
COMB
RORA
RORB
BRA RAM6
RAM4 COMB
BITB #9
BNE RAM5
RORA
RORB
BRA RAM6
RAM5 LSRA
RORB
RAM6 STD ,X++
EXG X,D SINCE IRQ RUNS OUT OF RAM, STROKE ROVER
TSTB
BNE RAM6B EVERY 256!
LDB #WDATA
STB WDOG HAVE A BONE..EVER BEEN BONED.....
TFR DP,B CHECK IS NORMAL DIAGS
CMPB #$FF FF MEANS FRONT DOOR
BNE RAM6C
LDB PIA0 CHECK FOR ADV.
BITB #2
BEQ RAM6C NOT PRESSED.
JMP ,Y TIME TO RETURN
RAM6C CLRB RETURN B TO ZERO
RAM6B EXG X,D TRADE BACK
CMPX #$C000 DONE??
BNE RAM3 NOPE..CONTINUE
*
TFR U,D RESTORE SEED.
LDX #0
RAM7 COMB
BITB #9
BNE RAM8
COMB
RORA
RORB
BRA RAM10
RAM8 COMB
BITB #9
BNE RAM9
RORA
RORB
BRA RAM10
RAM9 LSRA
RORB
RAM10 CMPD ,X++
BNE RERROR RAM ERROR!
RAM25 EXG X,D CHECK FOR END OF PAGE
TSTB
BNE RAM17
LDB #WDATA
STB WDOG
TFR DP,B SEE IF NORMAL RUN
CMPB #$FF FRONT DOOR??
BNE RAM17C NOPE
LDB PIA0 CHECK ADV.
BITB #2
BEQ RAM17C
JMP ,Y JUST RETURN (NO ERRORS)
RAM17C CLRB
RAM17 EXG X,D TRADE BACK
CMPX #$C000 DONE??
BNE RAM7
TFR D,U SHOVE NEW SEED OVER
TFR DP,A
CMPA #$FF FF INDICATES FRONT DOOR
BNE RAM99
TFR U,D
JMP RAM0 DO ANOTHER ITERATION IN THIS TEST.
RAM99 DECA TAKE ONE AWAY
TFR A,DP RETURN
CMPA #$80 ZERO OUT IN AUTO CYCLE???
BEQ RAM99$ YEP....
TSTA SET FOR BELOW BRANCH
TFR U,D MAKE SEED AND SAVED SEED LOOK ALIKE
LBNE RAM0 DO ANOTHER ITERATION
RAM99$ LDB #1 SET BACK TO ROM
STB RWCNTL
JMP ,Y RETURN
RERROR LEAX -2,X BACK TO ERROR POINT
EORA ,X FIND DIFFERENCE.
EORB 1,X
TSTA NO DIFFERENCE?
BNE RERR2 DIFF.
TSTB
BNE RERR2
LEAX 2,X UNDO THIS BULLSHIT...MAYBE ALPHA BABY.
BRA RAM25 AND CONTINUE
RERR2 LDU #$30 FIND BANK NUMBER
EXG X,D
CLRB
EXG X,D
RERR0 CMPX #0
BEQ RERR1 DONE.
LEAX -$100,X
LEAU $10,U
CMPU #$30
BLS RERR0
LDU #$10
BRA RERR0
RERR1 LEAU 1,U
ASRA
BCS RERR5 THIS IS THE BIT
ASRB
BCS RERR5
BRA RERR1
RERR5 TFR U,D BRING THE BANK,BIT INTO B
LDA #1 INDICATE RAM ERROR
STA RWCNTL BACK TO THAT JAZZ
LDS #RERR6 RETURN HERE
BRA PULSE PULSE THE LEDS
RERR6 LDA #RAM!>8
TFR A,DP
TFR CC,A
COMA
LDS #HSTK SET UP THE STACK
JSR SCCLR
BITA #$C0 INITIAL TEST???
BNE RER099 NOP
RER098 LDA #MSIND 'INITIAL TESTS INDICATE'
LDX #$3070
LDB #$22
JSR OUTPHR
RER099 LDA #MSRRM 'RAM ERROR '
LDX #$4090
LDB #$22
JSR OUTPHR PRINT THE MESSAGE.
TFR U,D
TFR B,A
LDB #$22
JSR OUTBCD
TFR CC,A SEE WHICH TEST
BITA #$40 FIRQ SAYS FRONT DOOR
BNE REROR7 NOPE
JMP FDRET DO THE FRONT DOOR RETURN
REROR7 LDY #CKCMSV OTHERWISE START...TRY AND RUN THE GAME.
BRA DELAY
DELAY LDA #32
DELA1 LDX #$5800
DELA2 LEAX -1,X
LDB #WDATA
STB WDOG
CMPX #0
BNE DELA2
DECA
BNE DELA1
JMP ,Y RETURN
*
* PULSE......PUT SOME CRAP IN LED'S
* LOW HALF OF A IS ERROR CODE...
* BOTH HALVES OF B ARE THE RELEVANT DATA.
*
PULSE TFR D,U SAVE A,B
LDA #2
TFR A,DP
PULSE0 TFR U,D
LDY #PULSE1
JMP PSSUB
PULSE1 LDA #2
LDY #PULSE2
BRA DELA1
PULSE2 LDY #PULSE3
BRA BLKLED
PULSE3 LDA #1
LDY #PULSE4
BRA DELA1
PULSE4 TFR U,D GET DATA BACK
TFR B,A SHIFT B DOWN
LSRA
LSRA
LSRA
LSRA PROPER HALF
LDY #PULSE5
BRA PSSUB PULSE IT.
PULSE5 LDA #2
LDY #PULSE6
BRA DELA1
PULSE6 LDY #PULSE7
BRA BLKLED
PULSE7 LDA #1
LDY #PULSE8
BRA DELA1
PULSE8 TFR U,D
TFR B,A
LDY #PULSE9
BRA PSSUB
PULSE9 LDA #2
LDY #PULS10
BRA DELA1
PULS10 LDY #PULS11
BRA BLKLED
PULS11 LDA #5
LDY #PULS12
BRA DELA1
PULS12 TFR DP,A SEE IF FIRST PASS??
DECA
TFR A,DP
BNE PULSE0
LDY #PULS95
BRA BLKLED BLANK EM.
PULS95 TFR U,D RESTORE D
JMP ,S AND RETURN
BLKLED LDA #$3C
STA PIA0+1
INCA
STA PIA1+1
LDA #$C0
STA PIA1
JMP ,Y AND RETURN
* PSSUB - PUT LOW HALF OF A TO LEDS
PSSUB TFR A,B SAVE A COPY.
RORA BIT 0 - CARRY
RORA BIT 0 - BIT 7
RORA BIT 0 - BIT 6
ANDA #$C0
STA PIA1 THOSE BITS OUT.
LDA #$34 ASSUME ZERO
BITB #$4 SEE IF 1
BEQ PSSUB1 NOPE
LDA #$3C
PSSUB1 STA PIA1+1 THATS ALL FOR THAT BIT
LDA #$34
BITB #$8
BEQ PSSUB2
LDA #$3C
PSSUB2 STA PIA0+1
JMP ,Y AND RETURN
ROMTST ORCC #$3F NO INTERRUPTS WHILE THIS RUNS
LDX #ROMTAB INDEX INTO TABLE
ROM0 CMPX #ROMEND DONE??
BNE ROM2 BRA= NOPE
ROMDUN JMP ,Y ALL ROMS OK...RETURN.
ROM2 LDA 1,X LOOK TO SEE IF PART STUFFED??
BEQ ROMBOT NOPE...MOVE TO NEXT
LDA ,X GET BASE
CLRB
TFR D,U USE U TO POINT THROUGH
LDA #WDATA FOR ROVER
ROM1 ADDB ,U+ ADD A BYTE
STA WDOG
EXG D,U SEE IF DUN
CMPA 2,X ARE WE TO NEXT PART
EXG D,U CHANGE BACK
BNE ROM1 NOPE
CMPB 1,X EXPECTED SUM???
BNE ROMERR NOPE....LETS SEND OUT PROBLEM WARNING.
ROMBOT LEAX 2,X MOVE TO NEXT PART
BRA ROM0
ROMERR LDA ,X GET THE ADDRESS OF THE BAD PART
LSRA
LSRA
LSRA
LSRA
CMPA #$D ONE OF TOP 3 PARTS??
BLO ROMER1 NOPE
SUBA #4 GROUP THEM WITH THE LOWER PARTS
ROMER1 ADDA #1 MAKE ERRORS FROM 1-12
DAA AND MAKE BCD
TFR A,B
LDA #2 ROM ERROR
LDS #RERR3 RETURN
JMP PULSE AND SEND OUT THE CODE
RERR3 LDA #RAM!>8
TFR A,DP
LDA #WDATA
STA WDOG
LDS #HSTK
JSR SCCLR
TFR CC,A
COMA
STB XTEMP
BITA #$C0 INITIAL TEST??
BNE RERR95 NOP
RERR94 LDA #MSIND 'INITIAL TESTS INDICATE'
LDX #$3070
LDB #$22
JSR OUTPHR
RERR95 LDA #MSROM 'ROM ERROR '
LDX #$4090
LDB #$22
JSR OUTPHR PRINT THE MESSAGE.
LDA XTEMP
BITA #$F0
BNE 1$
ORA #$F0
1$ LDB #$22
JSR OUTBCD
TFR CC,B SEE WHERE WE CAME FROM
BITB #$40 FIRQ SAYS FRONT DOOR
BNE ROMER3
JMP FDROM
ROMER3 LDY #CKCMSV NOW TRY AND RUN THE GAME
JMP DELAY BUT NOT UNTIL A SHORT DELAY.
* ROMTAB - THIS TABLE INDICATES THE BASE OF THE PART, AND THE
* RESULTING SUM. IF SUM=0 THEN PART IS NOT STUFFED.
IFE DEBUG FOR ROM VERSION
ROMTAB FCB $00,$A2 0000
FCB $10,$A9 1000
FCB $20,$50 2000
FCB $30,$FA 3000
FCB $40,$A7 4000
FCB $50,$BF 5000
FCB $60,$85 6000
FCB $70,$47 7000
FCB $80,$51 8000
FCB $90,$0 9000
FCB $A0,$0 A000
FCB $B0,$0 B000
FCB $C0,$0 C000
FCB $D0,$3D D000
FCB $E0,$D5 E000
FCB $F0,$77 F000
ROMEND FCB 0
FCB $11 CHECK BYTE (FUDGER) FOR THIS PART ($F000)
*
ELSE FOR DECON DEBUGGING
*
ROMTAB FCB $00,$0 0000
FCB $10,$0 1000
FCB $20,$0 2000
FCB $30,$0 3000
FCB $40,$0 4000
FCB $50,$0 5000
FCB $60,$0 6000
FCB $70,$0 7000
FCB $80,$0 8000
FCB $90,$0 9000
FCB $A0,$0 A000
FCB $B0,$0 B000
FCB $C0,$0 C000
FCB $D0,$0 D000
FCB $E0,$0 E000
FCB $F0,$0 F000
ROMEND FCB 0
FCB $0 CHECK BYTE (FUDGER) FOR THIS PART ($F000)
ENDIF
*
* ADVANCE SWITCH
*
ADVSW$ LDA #$04 MAKE SURE THAT NO ONE INTERRUPTS US
STA $C805
STA $C807
STA $C80D
STA $C80F
LDA #$FF
STA INDIAG
JSR INITCM INITIALIZE COLOR MATRIX
LDA PIA0 CHECK WHICH TYPE OF TEST
RORA AUTO UP??
LBCS BOOK YEP...GO TO BOOKKEEPING
JSR SCCLR
ORCC #$BF FIRQ ENABLED INDICATES NORMAL DIAGNOSTICS RUNNING.
LDY #DAG999
JMP BLKLED BLANK THE LEDS
DAG999 LDA #WDATA
STA WDOG
LDA PIA0 WAIT FOR ADVANCE SWITCH LET GO
BITA #2
BNE DAG999
LDY #DIAG0
JMP ROMTST DO THE ROM TEST
DIAG0 LDA #RAM!>8
TFR A,DP
JSR SCCLR CLEAR FOR ROMS MESSAGE.
LDA #TXROMK
JSR TEXT PRINT THE MESSAGE
LDB #3
DIG111 LDX #$7000
DIAG1 LDA #WDATA
STA WDOG
LDA PIA0
BITA #2
BNE DIAG2 CONTINUE IF ADVANCE PRESSED.
LEAX -1,X
CMPX #0
BNE DIAG1
DECB
BNE DIG111
DIG11$ LDY #DIAG2
LDX #0
LDA #$FF INDICATE FRONT DOOR
JMP RAMTST DO THE RAM TEST.
DIAG2 LDA #1
STA RWCNTL
LDA #RAM!>8
TFR A,DP
JSR SCCLR
LDA #TXRAMK
JSR TEXT PRINT RAM OK MESSAGE
DIAG22 LDA #WDATA
STA WDOG
LDA PIA0
BITA #2
BNE DIAG22 HOLD CONTROL UNTIL LET GO.
RAMERJ LDX #$9C00 RAM ERROR MESSAGE COMES HERE.
DIAG3 CLR ,X+ CLR USABLE MEMORY
LDB #WDATA
STB WDOG
CMPX #HSTK+1
BNE DIAG3
LDD #$A55A
STD HSEED
STA INDIAG INDICATE THAT WE'RE DIAGNOSTICS
BSR ZLED ZERO IN LED
DIAG4 JSR AVWAIT WAIT FOR ADVANCE SWITCH.
JSR CMTEST TEST CMOS.
LDA #TXCMOK
BCC DIAG66
LDB #$2F INDICATE THAT ITS IN R/W HALF
CMPX #CMOS+$100
BHI DIAG5 IT WAS IN WRITABLE HALF
LDB #$1F
DIAG5 LDS #DIAG55
LDA #$3
JMP PULSE
DIAG55 LDS #HSTK
BSR ZLED
LDA #RAM!>8
TFR A,DP
LDA #TXCMER
CMPB #$1F
BHI DIAG66
LDA #TXCMDR
DIAG66 JSR SCCLR
JSR TEXT PRINT ONE OF THE TWO MESSAGES.
JSR AVWAIT
CLR FDTEST INDICATE FRONT DOOR TEST CALLING
JSR SNDSRT START THE SOUND TEST
DIAG6 JSR SNDCYC CYCLE ONE SOUND
JSR AVCHK CHECK ADVANCE SWITCH.
BCC DIAG6 NOT PRESSED, DO ANOTHER SOUND
LDA #$3F
STA SOUND
CLRA
JSR JNAP
DIAG77 CLRA SILENCE
STA SOUND
JSR AVWAIT NOW WAIT FOR RELEASE.
JSR SWTEST DO A SWITCH TEST.
JSR AVWAIT WAIT FOR RELESE
JSR CRTEST DO THE COLOR MATRIX TEST
JSR AVCHK HOLDING BUTTON??
BCC DIAG78 NOPE...CONTINUE
JSR AVWAIT WAIT FOR LET GO TIME.
DIAG78 BRA TSTPAT DO SOME TEST PATTERNS THEN GO TO BOOK.
ZLED CLR PIA1 ZERO IN LED INDICATES ON LAST TEST OR DUN
LDA #$34
STA PIA0+1
INCA
STA PIA1+1
RTS
*
INITCM LDX #CRTAB
LDY #PCRAM
ADVS90 LDD ,X++
STD ,Y++
CMPX #CRTAB+16
BLO ADVS90
RTS
*
*** AUTO CYCLE
*
AUTCYC LDA #$3C MAKE SURE THAT NO ONE INTERRUPTS US
STA $C805
STA $C807
STA $C80D
STA $C80F
LDA #$3F MAKE LOOK LIKE FRONT DOOR TEST THANX TO MOTOROLA
TFR A,CC SET TO AUTOCYCLE NO INTS PLEASE ETC.
LDA #$8F FIFTEEN RAM PASSES, IN AUTOCYCLE
LDX RAMALS+$600 TAKE A BYTE FROM THE RAM TEST
LEAX $1234,X ADD A STUPID NUMBER TO VARY TEST
LDY #AUTO1
JMP RAMTST TEST THE RAM
AUTO1 LDY #AUTO2
JMP ROMTST
AUTO2 LDA #RAM!>8
TFR A,DP
LDS #HSTK JUST IN CASE
JSR CMTEST
BCC AUTO4
LDA #TXCMDR
CMPX #CMOS+$100 WRITE PROTECT??
BLS AUTO8
LDA #TXCMER
AUTO8 JSR SCCLR
JSR TEXT PRINT THE ERROR
AUTO5 LDA #WDATA
STA WDOG
BRA AUTO5
AUTO4 BSR BARS
LDY #AUTCYC
LDA #4
JMP DELA1
*
*** TEST PATTERNS
*
TSTPAT BSR CROSS DO FANCY HASSLER PAT.
JSR AVWAIT WAIT FOR ADVANCE
JSR SCCLR
LDA #$7 RED
STA PCRAM
JSR AVWAIT
LDA #$38 GREEN
STA PCRAM
JSR AVWAIT
LDA #$C0
STA PCRAM BLUE
JSR AVWAIT
BSR BARS
JSR AVWAIT
JMP BOOK
BARS LDX #CRAM
LDY #CBARCL
BARS0 LDD ,Y++ GET A COLOR
STD ,X++
LDA #WDATA
STA WDOG
CMPX #PCRAM+16
BLO BARS0
LDD #0
LDX #0
COLOR1 STX XTEMP
LEAX $F00,X
COLOR2 STD ,--X
PSHS A
LDA #WDATA
STA WDOG
PULS A
CMPX XTEMP
BNE COLOR2
LEAX $900,X
TSTA
BNE COLOR3
LDX #$D00
COLOR3 ADDD #$1111
BCC COLOR1
RTS
*
CBARCL FCB $5,$5,$28,$28,$80,$80,$0,$0
FCB $AD,$AD,$2D,$2D,$A8,$A8,$85,$85
*
* DON HASSLER CROSSHATCH
*
* RAM0 = BLACK - 00
* RAM1 = WHITE - FF
* RAM2 = BLUE - C0
* RAM3 = GREEN - 38
* RAM4 = RED - 07
*
CROSS JSR SCCLR CLEAR SCREEN
CLRA
JSR SETPCR ZERO COLOR MATRIX
CLR RWCNTL
LDA #$FF
STA CRAM+1
LDA #$C0
STA CRAM+2
LDA #$38
STA CRAM+3
LDA #$7
STA CRAM+4
LDY #WVERT MOVE WHITE VERTICALS
LDD #$0101
CROSS4 LDX 0,Y GET START PTR
LDB #WDATA
STB WDOG
LDB #$01
CROSS5 STD ,X++ MOVE IN WHITE
CMPX 2,Y CK IF LINE DONE
BNE CROSS5 NO, KEEP GOING
LEAY 4,Y INCR Y BY 4
CMPY #WVERTX CK IF ALL DONE
BNE CROSS4 NO, DO NEXT LINE
LDA #$11 MOVE WHITE HORIZ
LDY #WHORZ
CROSS2 LDX 0,Y GET START PTR
STX XTEMP
CROSS3 STA 0,X MOVE IN WHITE
INC XTEMP UPDATE PTR
LDB #WDATA
STB WDOG
LDX XTEMP
CMPX 2,Y CK IF DONE
BNE CROSS3 NO, KEEP GOING
LEAY 4,Y INCR Y BY 4
CMPY #WHORZX CK IF ALL DONE
BNE CROSS2 NO, DO NEXT LINE
LDY #HORIZ MOVE IN COLOR HORIZ.
CROSS6 LDX 0,Y GET START PTR
STX XTEMP
LDA 4,Y GET COLOR
CROSS7 STA 0,X MOVE IN COLOR
INC XTEMP
LDB #WDATA
STB WDOG
LDX XTEMP
CMPX 2,Y CK IF LINE DONE
BNE CROSS7 NO, KEEP GOING
LEAY 5,Y INCR Y BY 5
CMPY #HORIZX CK IF ALL DONE
BNE CROSS6 NO, DO NEXT LINE
LDY #VERT MOVE IN COLOR VERTICAL
CROSS8 LDX 0,Y GET START PTR
LDA 4,Y GET COLOR
CROSS9 STA ,X+ MOVE IN COLOR
LDB #WDATA
STB WDOG
CMPX 2,Y CK IF LINE DONE
BNE CROSS9 NO, KEEP GOING
LEAY 5,Y INCR Y BY 5
CMPY #VERTX CK IF ALL DONE
BNE CROSS8 NO, DO NEXT LINE
LDA #$21 BLUE TOUCH UP
STA $437E
LDA #$20
STA $937E
LDX #$4B0A
CROSSA LDA 0,X
ANDA #$F0
ORA #$02
LDB #WDATA
STB WDOG
STA ,X+
CMPX #$4B6D
BNE CROSSA
LDX #$4B90
CROSSB LDA 0,X
ANDA #$F0
ORA #$02
LDB #WDATA
STB WDOG
STA ,X+
CMPX #$4BF3
BNE CROSSB
LDX #$0B18
STX XTEMP MOVE IN DOTS
CROSSC LDX XTEMP
LDA 0,X OR IN DOT
ANDA #$F0
ORA #$01
STA 0,X STORE DOT
LDB XTEMP+1 UPDATE VERTICAL PTR
ADDB #$22
BCS CROSSD
STB XTEMP+1
BRA CROSSC
CROSSD LDB #$18
STB XTEMP+1 RE-INIT VERT. PTR
LDB XTEMP
ADDB #$10 UPDATE HORIZ PTR
STB XTEMP
CMPB #$9B CK IF DONE
BNE CROSSC NO, KEEP GOING
LDB #1
STB RWCNTL
LDB #WDATA
STB WDOG
RTS
*
* CROSS HATCH DATA
*
WHORZ FDB $0407
FDB $9407
FDB $0429
FDB $9429
FDB $044B
FDB $944B
FDB $046D
FDB $946D
FDB $048F
FDB $948F
FDB $04B1
FDB $94B1
FDB $04D3
FDB $94D3
FDB $04F5
FDB $94F5
WHORZX EQU *
WVERT FDB $0307
FDB $03F5
FDB $1307
FDB $13F5
FDB $2307
FDB $23F5
FDB $3307
FDB $33F5
FDB $4307
FDB $43F5
FDB $5307
FDB $53F5
FDB $6307
FDB $63F5
FDB $7307
FDB $73F5
FDB $8307
FDB $83F5
FDB $9307
FDB $93F5
WVERTX EQU *
HORIZ FDB $4505
FDB $5205
FCB $44
FDB $4506
FDB $5206
FCB $44
FDB $4507
FDB $5207
FCB $00
FDB $4508
FDB $5208
FCB $33
FDB $4509
FDB $5209
FCB $33
FDB $45F3
FDB $52F3
FCB $33
FDB $45F4
FDB $52F4
FCB $33
FDB $45F5
FDB $52F5
FCB $00
FDB $45F6
FDB $52F6
FCB $44
FDB $45F7
FDB $52F7
FCB $44
FDB $047E
FDB $437E
FCB $22
FDB $547E
FDB $937E
FCB $22
HORIZX EQU *
VERT FDB $026F
FDB $028E
FCB $04
FDB $036F
FDB $038E
FCB $30
FDB $936F
FDB $938E
FCB $00
FDB $946F
FDB $948E
FCB $34
VERTX EQU *
*
*** COLOR MATRIX TEST
*
CRTEST JSR SCCLR CLEAR OUT BABY
LDA #TXCMT PRINT THE MESSAGE
JSR TEXT
LDA #$80
STA SW0ST
CRTST1 CLRA
JSR JNAP
CRTST2 JSR AVCHK PRESS??
BCS CMTBYE NOPE
DEC SW0ST DONE WITH DELAY??
BNE CRTST1
LDA COLRMT GET FIRST COLOR.
BSR SETPCR STORE IT DOWN
BSR RAMBAR SET UP MEMORY.
CRTT$$ LDX #COLRMT TABLE TO STORE
CRTST3 LDA ,X+ GET A COLOR
STX XTEMP
BSR SETPCR STORE IT THROUGH
LDA #$80
STA SW0ST
CRTST4 CLRA
JSR JNAP
CRTST5 JSR AVCHK ADVANCE??
BCS CMTBYE YEP
DEC SW0ST
BNE CRTST4
LDX XTEMP RESTORE POINTER
CMPX #COLRMT+8
BLO CRTST3
BRA CRTT$$ CONTINUE THROUGH
CMTBYE RTS
RAMBAR LDX #$0
LDY #COLRMD NUMBERS TO PUT IN BARS
RAMBA1 STX XTEMP SAVE OUR X
LEAX $F00,X
LDA ,Y+
RAMBA2 TFR A,B
STD ,--X
LDB #WDATA
STB WDOG
CMPX XTEMP
BNE RAMBA2
LEAX $900,X
TSTA
BNE RAMBA3
LDX #$D00
RAMBA3 CMPY #COLRMD+16
BNE RAMBA1
RTS
COLRMT FCB $02,$03,$04,$10,$18,$20,$40,$80
COLRMD FCB $00,$FF,$11,$EE,$22,$DD,$33,$CC
FCB $44,$BB,$55,$AA,$66,$99,$77,$88
SETPCR LDX #CRAM
SETPC1 STA ,X+
CMPX #CRAM+16
BLO SETPC1
RTS
*
*** SWITCH TEST
*
SWMH EQU 44 HEIGHT OF FIRST MESSAGE
SWTEST LDA #10
STA XTEMP DELAY COUNTER FOR EXIT
JSR SCCLR CLEAR IT PLEASE
LDA #TXSWTS SWITCH TEST MESSAGE.
JSR TEXT
LDB #WDATA
STB WDOG
LDU #SW0ST
SWTES0 CLR ,U+
CMPU #SW3SCI
BLS SWTES0
SWTES2 LDU #STABP
BSR SWSCN0
SWTES1 LDA #$34
STA PIA3+1
LDB #WDATA
STB WDOG
BSR SWSCN0 SCAN THE COCKTAIL SIDE
LDA #$3C
STA PIA3+1
BSR SWDISP
JSR AVCHK ADVANCE PRESSED?
BCC SWT999 NOPE.
LDB #WDATA
STB WDOG
DEC XTEMP
BEQ SWTBYE
SWT999 CLRA
JSR JNAP
BRA SWTES2
SWTBYE RTS
SWSCN0 LDX ,U++ GET ADDRESS OF PORT
BEQ SWSCN5 DONE
LDY ,U++ GET ADDRESS TO STORE STATE
LDA ,X GET NEW STATE
EORA ,Y SEE WHERE DIFFERENT
STA 1,Y AND SAVE AS DIFFERENCE BYTE.
BRA SWSCN0
SWSCN5 RTS
SWDISP LDU #SPHTAB WE'LL WALK THROUGH SWITCH PHRASE TABLE
LDY #SW0ST WALK THROUGH THE SCANNED STUFF.
SWDIS4 LDB #1 WALK FROM LSB
SWDIS0 BITB 1,Y SEE IF THIS BIT CHANGED.
BEQ SWDIS2
BSR SWACT TAKE SOME ACTION
SWDIS2 LEAU 3,U MOVE TO NEXT ENTRY
ASLB SHIFT ONE DOWN
BCC SWDIS0
LDB #WDATA
STB WDOG
LEAY 2,Y TO NEXT BYTE
CMPY #SW3SCI PAST TABLE
BHI SWDIS9 YEP..DONE
* LDA PIA3 COCKTABLE
* BMI SWDIS4 YEP...FULL SCAN
BRA SWDIS4 YEP...FULL SCAN