forked from historicalsource/smashtv
-
Notifications
You must be signed in to change notification settings - Fork 1
/
DIAG.ASM
3124 lines (2722 loc) · 69.6 KB
/
DIAG.ASM
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
.WIDTH 132
.OPTION B,D,L,T
.MNOLIST
*
*COBRA CRAP ********************TO BE REMOVED*************************
*
; .DEF O_COB,COBBUL,CKPLYR,CHKFREE
;O_COB .EQU 0
;COBBUL .EQU 0
;CKPLYR .EQU 0
;CHKFREE .EQU 0
*********************************TO BE REMOVED*************************
**************************************************************************
* CODE JANITORS: JAMIE BEGELMAN, KURT MAHAN, EUGENE P. JARVIS
* COPYRIGHT (C) 1990 WILLIAMS ELECTRONICS GAMES INC.
* ALL RIGHTS RESERVED.
*
**************************************************************************
.include "gsp.inc" ;gsp assembler equates
.include "sys.inc" ;z unit system equates
.include "macros.hdr" ;macros definitions
.INCLUDE MPROC.EQU
.INCLUDE LINK.EQU
.INCLUDE IMGTBL.GLO
*********************************************************
**************************************************************************
* *
* DEFS AND REFS *
* *
**************************************************************************
.REF WDISTAB,SNDSND,INTIO,WARMSET,GET_AUD,STORE_AUDIT,WDOGDIS
.DEF POWERTST
.DEF CROSS_H,SW_CHK,CPU_CHK,COL_BARS,BURN_IN,STRNEW1
; .DEF SWITCHTEST, CONV_PLOT, DIPTEST, DIAGCPUTEST, POWERCMOS
; .DEF CHECKDIPFREE, READ_DIP, FORCEDIP
; .DEF BURNIN, COLORBAR
.DEF CIRCLE, HVLINE, STRING, RECTANGLE, POINT, DSCRCLR, INITCOLR
; .DEF STRINGCENTER
; .REF SNDRES,POWERRET, INITCOLR
; .REF ROM_NAME, CMOS_VAL, FAC_SET, INIT_TAB, WARMSET, PCMOSRET
; .REF INIT_TB, ALL_TAB, TOD_TAB
; .REF GET_HSC, INIT_HSR, VAL_TAB
; .REF CMOSLOCK, CMOSUNLOCK, CPU_RET, CLSCRACH, EXEC_LP, COLOR_START
; .REF DIPINIT, CLRALLPD, SINTRAM, IRQLED, EXECLED
; .REF WDOGRAM
; .REF WC_BYTEI, RC_BYTEI, WIPEOUT, RC_LONGI, WC_LONGI
; .REF CLR_AUD, STORE_AUDIT
;
; .REF KILL_AUD
; .REF WDOGDIS, WDISTAB
; .REF CKTEST
;
; .REF DIPCOINTAB, SET_COIN_ADJ
; .REF GET_CSPT, PUT_ADJ
; .REF BLASTMESS
; .REF CLEAR_HSCOLORS
.REF SNDTST
.REF SYSCOPY
.BSS SWSET1,32 ; FOR SWITCH TEST
.BSS SWSET2,32
.BSS DIPVAL,16
.BSS FORCEDIP,16 ; FOR FORCING THE USE OF THE DIP
.BSS CERRORS,32
.BSS CPASSES,32
.BSS SCHANGE,16
.TEXT
.EVEN
**************************************************************************
* *
* USEFUL MACROS *
* *
**************************************************************************
*
* TIMED PAUSE
*
PAUSE $MACRO TIME, REG
MOVI :TIME:, :REG:, L
LABEL?: NOP
DSJS :REG:, LABEL?
$ENDM
*
*BIT SET
* BSET BIT# 0-31(KONSTANT OR REGISTER),REGISTER TO SET BIT IN
* NOTE: A14 IS DESTROYED, 'A' FILE REGISTERS ONLY
*
BSET $MACRO P1,R1
MOVK 1,A14
SLL :P1:,A14
OR A14,:R1:
$ENDM
*
*FCALL - FUNCTION CALL WITHOUT USING THE SYSTEM STACK
* FCALL ROUTINE, BREG
*
FCALL $MACRO NAME, BREG
MOVI :NAME:, :BREG:, L
EXGPC :BREG:
$ENDM
*
*FRET - FUNCTION RETURN WITHOUT USING THE SYSTEM STACK
* FCALL ROUTINE, BREG
*
FRET $MACRO BREG
EXGPC :BREG:
$ENDM
BUT_MAC $MACRO X,Y,RADIUS,COLOR,MASK,SHIFT,EXTEND
.WORD :X:
.WORD :Y:
.WORD :RADIUS:
.LONG :COLOR:
.LONG :MASK:
.WORD :SHIFT:
.WORD :EXTEND:
$ENDM
STR_MAC $MACRO X,Y,STRING,COLOR,DIR
.WORD :X:
.WORD :Y:
.LONG :STRING:
.WORD :COLOR:
.WORD :DIR:
$ENDM
VECMAC $MACRO COLOR,X1,Y1,X2,Y2
.WORD :COLOR:
.WORD :X1:
.WORD :Y1:
.WORD :X2:
.WORD :Y2:
$ENDM
DOTMAC $MACRO COLOR,X,Y
.WORD :COLOR:
.WORD :X:
.WORD :Y:
$ENDM
RECTMAC $MACRO COLOR,X,Y,W,H
.WORD :W:
.WORD :H:
.WORD :X:
.WORD :Y:
.WORD :COLOR:
$ENDM
CHIPMAC $MACRO NUM,X1,Y1,X2,Y2,X3,Y3,STRING,DIR,X4,Y4,STUFFED
.WORD :NUM:
.WORD :X1:
.WORD :Y1:
.WORD :X2:
.WORD :Y2:
.WORD :X3:
.WORD :Y3:
.LONG :STRING:
.WORD :DIR:
.WORD :X4:
.WORD :Y4:
.WORD :STUFFED:
$ENDM
CMNUM EQU 0
CMLOC EQU CMNUM+16
CMXLOC EQU CMLOC
CMYLOC EQU CMLOC+16
CMSIZE EQU CMLOC+32
CMXSIZE EQU CMSIZE
CMYSIZE EQU CMSIZE+16
CMOFFSET EQU CMSIZE+32
CMSTRING EQU CMOFFSET+32
CMDIR EQU CMSTRING+32
CMPINLOC EQU CMDIR+16
CMSTUFFED EQU CMPINLOC+32
CMEND EQU CMSTUFFED+16
**************************************************************************
* *
* RAM_CHIP: MACRO DEFINES A RAM CHIP RECORD. *
* *
* CHIP_NO -- CHIP NUMBER *
* WIDTH -- CHIP CELL SIZE IN BITS (MUST BE > 0) *
* INTERLEAVE -- DISTANCE BETWEEN ADJACENT CELLS ON CHIP (IN BITS) *
* START_ADDR -- ADDRESS OF FIRST CELL ON CHIP *
* END_ADDR -- ADDRESS OF LAST CELL ON CHIP *
* *
**************************************************************************
RAM_CHIP $MACRO TAB_LINK,CHIP_NO, WIDTH, INTERLEAVE, START_ADDR, END_ADDR
.WORD :WIDTH:
.WORD :INTERLEAVE:
.WORD :CHIP_NO:
.LONG :START_ADDR:
.LONG :END_ADDR:
.LONG :TAB_LINK:
$ENDM
RAM_WDTH EQU 000H ; OFFSETS INTO RAM CHIP RECORD
RAM_ITLV EQU 010H
RAM_NMBR EQU 020H
RAM_SADR EQU 030H
RAM_EADR EQU 050H
RAM_LINK EQU 070H
RAM_SIZE EQU 090H
ROM_CKSM EQU 000H
ROM_WDTH EQU 010H ; OFFSETS INTO ROM CHIP RECORD
ROM_ITLV EQU 020H
ROM_NMBR EQU 030H
ROM_SADR EQU 040H
ROM_EADR EQU 060H
ROM_LINK EQU 080H
ROM_SIZE EQU 0A0H
;****************************************************************************
;* ROM_CHIP: MACRO DEFINES A ROM CHIP RECORD. *
;* *
;* CHIP_NO -- CHIP NUMBER *
;* WIDTH -- CHIP CELL SIZE IN BITS (MUST BE > 0) *
;* INTERLEAVE -- DISTANCE BETWEEN ADJACENT CELLS ON CHIP (IN BITS) *
;* START_ADDR -- ADDRESS OF FIRST CELL ON CHIP *
;* END_ADDR -- ADDRESS OF LAST CELL ON CHIP *
;* CHECK_SUM -- DATAIO CHECK SUM FOR CHIP *
;****************************************************************************
ROM_CHIP $MACRO TAB_LINK,CHIP_NO, WIDTH, INTERLEAVE, START_ADDR, END_ADDR, CHECK_SUM
.WORD :CHECK_SUM:
.WORD :WIDTH:
.WORD :INTERLEAVE:
.WORD :CHIP_NO:
.LONG :START_ADDR:
.LONG :END_ADDR:
.LONG :TAB_LINK:
$ENDM
RANDOM_SEED EQU 5A5A5A5Ah ; RAM TESTS: PSEUDO-RANDOM SEQUENCE
ZERO_EXTEND EQU 1Fh ; PARAMETERS
SIGN_EXTEND EQU 20h
PAL_SELECT EQU 0FFDCH ; ENABLE VIDEO PALETTE MAP ACCESS
**************************************************************************
* *
* POWERTST *
* *
* POWERUP SELF TEST ROUTINES *
* *
* ENTRY *
* NOTHING *
* *
* EXIT *
* NOTHING *
* *
**************************************************************************
.TEXT
BURN_IN
DINT
MOVI STCKST-100H,SP,L
JRUC POWERTST1
CPU_CHK
POWERTST
.IF DEBUG
JAUC WARMSET
.ENDIF
DINT
MOVI STCKST,SP,L
POWERTST1
SETF 16, 0, 0
SETF 32, 0, 1
; HALT DMA AND ENABLE CACHE
CLR A14
MOVE A14, @DMACTRL
MOVE A14, @CONTROL
*THESE STROBE EQUATES ARE FOR THE PINBALL SOUND CARD
RESETBIT EQU 0FE00H ;THIS IS THE ^RESET BIT
MUSICBIT EQU 0FD00H ;THIS IS THE YAMAHA SIDE STROBE
SOUNDBIT EQU 0FD00H ;THIS IS THE SOUND SIDE STROBE
; RESET SOUND BOARD
MOVI RESETBIT,A0 ;HIT RESET BIT
MOVE A0,@SOUND
MOVI 100,A0 ;WAIT FOR IT TO CATCH
DSJS A0,$
; CLR A0
NOT A0
MOVE A0,@SOUND
; DISABLE VIDEO PALETTE RAMS, AUTOERASE AND ERROR LED
MOVI 0FFFCH,A13
MOVE A13,@SYSCTRL,W
; MOVE A13,@SYSCOPY
; DISABLE WATCH DOG
; SETF 16,1,0 ;SIGN EXTENSION ON FOR THIS
MOVI WDISTAB,A1
MOVK 1,A3
MOVI 0FFFCH,A2
MOVE *A1+,A0,W
WDOGSL
OR A2,A0
MOVE A0,@SYSCTRL,W
XOR A3,A0
MOVE A0,@SYSCTRL,W
MOVE *A1+,A0,W
SEXT A0,W
JRNN WDOGSL
; SETF 16,0,0 ;BACK OFF FOR BEGLEMAN SHIT
; INITIALIZE IO REGISTERS
FCALL INTIO,B6
CLR B0
MOVI VRAMCHIPS, A14 ; VERIFY COLOR/VIDEO RAMS
FCALL RAMCHECK, B5
; ENABLE VIDEO PALETTE MAP ACCESS
MOVI PAL_SELECT, A13
MOVE A13,@SYSCTRL,W
MOVI PALCHIPS, A14 ; VERIFY VIDEO PALETTE MAP RAMS
FCALL RAMCHECK, B5
MOVE B0,A12
; DISABLE VIDEO PALETTE MAP ACCESS
MOVI 0FFFCH,A13
MOVE A13,@SYSCTRL,W
FCALL INITCOLR, B5 ; DISPLAY CPU BOARD
FCALL DSCRCLR,B6
FCALL CPUDRAW,B5
MOVI CPU,A10 ; WE GOT THIS FAR, CPU MUST BE OK
MOVI 1,A11
FCALL CHIPOUT,B5
MOVI VRAMTAB,A9
FCALL CHIPTABLE,B5 ; PLOT OUT THE CHIP TABLE
MOVE A12,A12
JRZ PDMACK
PBADRAM
MOVI RAMBADMESS,A0
JRUC CPUBADM
; MOVI [128,130],A1
; CLR A2
; MOVI ROBO_RED,A3
; FCALL STRING,B6
; JRUC PCPUBAD
PDMACK
MOVI DMACMESS,A0
MOVI [128,130],A1
CLR A2
MOVI ROBO_YELLOW,A3
FCALL STRING,B6
FCALL DMACHECK,B5 ; CHECK THE DMA
MOVI DMA,A10
MOVE A0,A11
MOVE A0,A12
INC A11 ; GREEN/RED
FCALL CHIPOUT,B5
MOVI [128,130],A0
MOVI [10,260],A1
MOVI ROBO_BLACK,A2
FCALL RECTANGLE,B6
MOVE A12,A12
JRZ PSRAMCK ;MESSAGE FOR DMA BAD
MOVI DMABADMESS,A0
JRUC CPUBADM
; MOVI [128,130],A1
; CLR A2
; MOVI ROBO_RED,A3
; FCALL STRING,B6
; JRUC PCPUBAD
PSRAMCK
MOVI SRAMCHECK,A0
MOVI [128,130],A1
CLR A2
MOVI ROBO_YELLOW,A3
FCALL STRING,B6
; MOVI 0FF3CH,A13 ;SELECT PAGE ZERO CMOS
; MOVE A13,@SYSCTRL,W
MOVI 0200H,A0 ;UNLOCK CMOS
MOVE A0,@SECCHIP,W
CLR B0
MOVI SRAMCHIPS,A14 ; VERIFY SCRATCH RAMS
FCALL RAMCHECK, B5
MOVE B0,A12
MOVI 0300H,A0 ;LOCK CMOS
MOVE A0,@SECCHIP,W
MOVI 0FFFCH,A13
MOVE A13,@SYSCOPY
; MOVI SRAMTAB,A9
; FCALL CHIPTABLE,B5
MOVI [128,130],A0
MOVI [10,260],A1
MOVI ROBO_BLACK,A2
FCALL RECTANGLE,B6
MOVE A12,A12
JRNZ PBADRAM
;
; ROM CHANGES
;
PROMCK
MOVI ROMCMESS,A0
MOVI [128,130],A1
CLR A2
MOVI ROBO_YELLOW,A3
FCALL STRING,B6
CLR B0
MOVI PROMCHIPS,A14
FCALL ROMCHECK,B5
MOVE B0,B0
JRNZ PBADROM ; FOR NOW, WOOF WOOF
CLR B0 ; CHECK ROMS
MOVI IROMCHIPS,A14
FCALL ROMCHECK,B5
MOVE B0,A12
MOVI [128,130],A0
MOVI [10,260],A1
MOVI ROBO_BLACK,A2
FCALL RECTANGLE,B6
MOVE A12,A12
JRZ PCPUGOOD
PBADROM
MOVI [128,130],A0
MOVI [10,260],A1
MOVI ROBO_BLACK,A2
FCALL RECTANGLE,B6
MOVI ROMBADMESS,A0
CPUBADM
MOVI [128,130],A1
CLR A2
MOVI ROBO_RED,A3
FCALL STRING,B6
;
; END OF ROM CHANGES
;
PCPUBAD
; MOVI CPUPAUSE,A0
; MOVI [143,130],A1
; CLR A2
; MOVI ROBO_RED,A3
; FCALL STRING,B6
PCPUBADL
PAUSE 1200000H,B6 ; GIVE THE GUY A GLIMPSE
CMPI STCKST,SP ;AUTO CYCLE ?
JRNE PCPUBADL ; YES, LOOP ON BAD
JRUC PCPURET
PCPUGOOD
MOVI CPUGOOD,A0
MOVI [143,130],A1
CLR A2
MOVI ROBO_GREEN,A3
FCALL STRING,B6
PAUSE 600000H,B6 ; GIVE THE GUY A GLIMPSE
PCPURET
CMPI STCKST,SP ;AUTO CYCLE ?
JREQ PCPURET1 ; NOPE...
CLR A13
SETF 16,1,0 ;WORD SIGN EXTEND (FIELD 0)
CALLA SNDTST
JRUC BURN_IN
PCPURET1
JAUC WARMSET
WAIT DSJS B6,WAIT
WAIT1
MOVE @SWITCH,A0,L
BTST 20,A0
JREQ WAIT1
RETS
;*
;*DO CPU TEST, RETURNS TO CPUTESTR
;CPU_CHK:
; DINT
; CALLR WDOGDIS
; JAUC CPUTEST
;*
;*CPU TEST RETURN POINT
;CPUTESTR:
; MOVI RT_RET,B0
; JRUC BTESTR
;*ROM BOARD TEST RETURN POINT
;ROMTESTR:
; MOVI ROM_RET,B0
;BTESTR:
; MOVI DIAG_PID,A1
; CALLA GETPRC ;CREATE PROCESS FOR RETURN
; MOVI INAMODE,A0
; MOVE A0,@GAMSTATE,W
; JAUC WARMSET
;*
;*CHECK THE ROM BOARD, THIS IS THE ONLY PLACE TO CALL ROMTEST
;*NO REGISTERS ARE PRESERVED
;CHECKROM:
; PUSHST
; DINT
; MOVE SP,@SPTEMP,L
; CALLR WDOGDIS
; JAUC ROMTEST
**************************************************************************
* *
* MONITOR STUFF *
* *
**************************************************************************
CROSS_H
CONV_PLOT:
MOVI MON_RECS,A9
CPRLP1
MOVE *A9+,A2,W ; GET COLOR
JRZ CPRDONE
MOVE *A9+,A0,L ; START POINT
MOVE *A9+,A1,L ; DIMENSIONS
FCALL RECTANGLE,B6
JRUC CPRLP1
CPRDONE
MOVI MON_VECS,A9 ; POINT AT VECTOR TABLE
CPVLP1
MOVE *A9+,A2,W ; GET COLOR
JRZ CPVDONE
MOVE *A9+,A0,L ; START POINT
MOVE *A9+,A1,L ; END POINT
FCALL HVLINE,B6
JRUC CPVLP1
CPVDONE
MOVI MON_DOTS,A9 ; POINT AT DOT TABLE
CPDLP1
MOVE *A9+,A1,W ; GET COLOR
JRZ CPDDONE
MOVE *A9+,A0,L ; GET THE POINT
FCALL POINT,B6
JRUC CPDLP1
CPDDONE
RETS
**************************************************************************
* *
* MONITOR TEST DATA AREA *
* *
**************************************************************************
MON_VECS:
VECMAC ROBO_WHITE,004,004,390,004
VECMAC ROBO_WHITE,004,004,004,250
VECMAC ROBO_WHITE,004,250,390,250
VECMAC ROBO_WHITE,390,250,390,004
VECMAC ROBO_WHITE,060,005,060,250
VECMAC ROBO_WHITE,115,005,115,250
VECMAC ROBO_WHITE,170,005,170,250
VECMAC ROBO_WHITE,225,005,225,250
VECMAC ROBO_WHITE,280,005,280,250
VECMAC ROBO_WHITE,335,005,335,250
VECMAC ROBO_WHITE,005,54,390,54
VECMAC ROBO_WHITE,005,103,390,103
VECMAC ROBO_WHITE,005,152,390,152
VECMAC ROBO_WHITE,005,201,390,201
.LONG 0
MON_RECS:
VECMAC ROBO_RED,182,000,030,005 ; TOP
VECMAC ROBO_GREEN,182,005,030,006
VECMAC ROBO_RED,182,250,030,005 ; BOTTOM
VECMAC ROBO_GREEN,182,244,030,006
VECMAC ROBO_RED,000,117,005,020 ; LEFT
VECMAC ROBO_GREEN,005,117,006,020
VECMAC ROBO_RED,390,117,005,020 ; RIGHT
VECMAC ROBO_GREEN,384,117,006,020
.LONG 0
MON_DOTS:
DOTMAC ROBO_WHITE,032,029
DOTMAC ROBO_WHITE,087,029
DOTMAC ROBO_WHITE,142,029
DOTMAC ROBO_WHITE,197,029
DOTMAC ROBO_WHITE,252,029
DOTMAC ROBO_WHITE,307,029
DOTMAC ROBO_WHITE,362,029
DOTMAC ROBO_WHITE,032,078
DOTMAC ROBO_WHITE,087,078
DOTMAC ROBO_WHITE,142,078
DOTMAC ROBO_WHITE,197,078
DOTMAC ROBO_WHITE,252,078
DOTMAC ROBO_WHITE,307,078
DOTMAC ROBO_WHITE,362,078
DOTMAC ROBO_WHITE,032,127
DOTMAC ROBO_WHITE,087,127
DOTMAC ROBO_WHITE,142,127
DOTMAC ROBO_WHITE,197,127
DOTMAC ROBO_WHITE,252,127
DOTMAC ROBO_WHITE,307,127
DOTMAC ROBO_WHITE,362,127
DOTMAC ROBO_WHITE,032,176
DOTMAC ROBO_WHITE,087,176
DOTMAC ROBO_WHITE,142,176
DOTMAC ROBO_WHITE,197,176
DOTMAC ROBO_WHITE,252,176
DOTMAC ROBO_WHITE,307,176
DOTMAC ROBO_WHITE,362,176
DOTMAC ROBO_WHITE,032,225
DOTMAC ROBO_WHITE,087,225
DOTMAC ROBO_WHITE,142,225
DOTMAC ROBO_WHITE,197,225
DOTMAC ROBO_WHITE,252,225
DOTMAC ROBO_WHITE,307,225
DOTMAC ROBO_WHITE,362,225
.LONG 0
PRIMARY_COLORS:
RECTMAC ROBO_RED,0,0,395,255
RECTMAC ROBO_GREEN,0,0,395,255
RECTMAC ROBO_BLUE,0,0,395,255
.LONG 0
COLOR_BARS:
RECTMAC ROBO_BLACK, 0, 0, 49, 16
RECTMAC ROBO_BLACK, 49, 0, 49, 16
RECTMAC ROBO_BLACK, 98, 0, 49, 16
RECTMAC ROBO_BLACK, 147, 0, 49, 16
RECTMAC ROBO_BLACK, 196, 0, 49, 16
RECTMAC ROBO_BLACK, 245, 0, 49, 16
RECTMAC ROBO_BLACK, 294, 0, 49, 16
RECTMAC ROBO_BLACK, 343, 0, 49, 16
.LONG 0
**************************************************************************
* *
* COLORBAR *
* *
**************************************************************************
COL_BARS
COLORBAR:
MOVI INTENSITIES_START, A0, L
MOVI COLRAM+100H,A1, L
MOVK 16, A2 ; 5 BITS / COLOR
MOVK 8, A6 ; # COLOR BARS
CB3
ADDI 0F00H,A1 ;STEP TO NEXT PALETTE
MOVE *A0+, A3 ; STARTING COLOR
MOVE *A0+, A4 ; COLOR DECREMENT
MOVE A2, A5
CB4 MOVE A3, *A1+
SUB A4, A3
DSJS A5, CB4
DSJS A6, CB3
; =========================
; | DISPLAY COLOR BARS |
; =========================
CLR A14
MOVE A14,@DMAGO ; HALT THE DMA
MOVI 0101H,A14
MOVE A14,A8
MOVI COLOR_BARS, A3, L ; COLOR BAR TABLE
MOVI [16,0], A13, L ; POSITION INCRMENT
MOVI 101H,A12
MOVK 16, A11 ; # INTENSITIES / BAR
MOVK 8,A6 ;THIS MANY BARS
CB6
CLR A2 ; STARTING COLOR
MOVE *A3+,A1,L
JRZ CB8
MOVE A8,@DMACMAP,W ;STUFF PALETTE
MOVE *A3+,A0,L
ADDK 16,A3
MOVE A11,A10
CB7
FCALL RECTANGLE, B6
ADD A13, A0
ADD A12, A2
DSJS A10, CB7
ADD A14,A8 ;NEXT PALETTE PLEASE
DSJ A6,CB6
CB8
CLR A14
MOVE A14,@DMACMAP,W
RETS
INTENSITIES_START:
.WORD 03E0H ; GREEN
.WORD 0040H ; BUMP GREEN
.WORD 7C00H ; RED
.WORD 0800H ; BUMP RED
.WORD 001FH ; BLUE
.WORD 0002H ; BUMP BLUE
.WORD 0000H ; BLACK
.WORD 0000H ; BUMP BLACK
.WORD 7FFFH ; WHITE
.WORD 0842H ; BUMP WHITE
.WORD 7FE0H ; YELLOW
.WORD 0840H ; BUMP YELLOW
.WORD 7C1FH ; PURPLE
.WORD 0802H ; BUMP PURPLE
.WORD 03FFH ; CYAN
.WORD 0042H ; BUMP CYAN
.LONG 0
**************************************************************************
* *
* SWITCHTEST *
* *
* DRAW OUT THE ROBO SWITCHES -- A PRETTY PICTURE *
* *
* ENTRY *
* NOTHING *
* *
* EXIT *
* NOTHING *
* *
**************************************************************************
;DONEMASK EQU 00100000H ;TEST SWITCH
DONEMASK EQU 00240000H ; P1 + P2 START
.BSS DONECNT,32 ; FOR SWITCH TEST
SW_CHK
SWITCHTEST:
MMTM SP,A12,A13
; CALLA WDOGDIS
MOVI 010H,A13
MOVE A13,@DONECNT,L
CLR A13 ; THE HOLD ME REGISTER
MOVE A13,@SWSET1,L
MOVE A13,@SWSET2,L
MOVI BUT_TABLE,A9
CLR A10
CALLR BUT_PLOT ; PLOT SOME BUTTONS
MOVI JOY_TABLE,A9
CALLR JOY_PLOT ; PLOT THE JOYSTICKS
MOVI STR_TABLE,A9
CALLR STR_PLOT ; PLOT THE STRINGS
MOVI 00B90000H,A0
MOVI 00B90190H,A1
MOVI ROBO_WHITE,A2
FCALL HVLINE,B6 ; DRAW LITTLE WHITE LINE
SDLOOP
MMFM SP,A12,A13
SLEEP 1
MMTM SP,A12,A13
MOVE @SWITCH,A10,L ; GRAB ME A SWITCH REGISTER
NOT A10
MOVE A10,A0
ANDI DONEMASK,A0
CMPI DONEMASK,A0,L ; CHECK FOR DONE
JRNZ SDGO
MOVE @DONECNT,A0,L ;REQUIRE A CERTAIN TIME
DEC A0
MOVE A0,@DONECNT,L
JRNE SDGO
MMFM SP,A12,A13
RETP
SDGO
MOVE @SWSET1,A11,L
CMP A11,A10 ; CHECK FOR CHANGES
JRZ SDCK2
MOVE A10,@SWSET1,L
MOVE @SWITCH+32,A10,L
NOT A10
SLL 24,A10
SRL 24,A10
; ANDI 0FFH,A10
JRUC SDPRC1
; MOVE A10,@SWSET2,L
; JRUC SDPROC
SDCK2
MOVE @SWITCH+32,A10,L
NOT A10
SLL 24,A10
SRL 24,A10
; ANDI 0FFH,A10
MOVE @SWSET2,A11,L
CMP A11,A10
JRZ SDLOOP
SDPRC1
MOVE A10,@SWSET2,L
SDPROC
CLR A0
MOVE A0,@SCHANGE,W
MOVI BUT_TABLE,A9
CALLR BUT_PLOT
MOVI JOY_TABLE,A9
CALLR JOY_UPDATE ; UPDATE THE JOYSTICK INFO
MOVE @SCHANGE,A0,W
JRZ SDLOOP
MOVI 0FD80H,A0
MOVE A0,@SOUND,W
MOVI 0FF80H,A0
MOVE A0,@SOUND,W
JRUC SDLOOP
*
*DIP SWITCH TEST
*
DIPTEST
MOVI 0C8H,A12
MOVI DIPTAB,A9
CALLR STR_PLOT ; PLOT THE STRINGS
DIPL
MOVE @VCOUNT,A1,W ; CUT BEAM INTERFERENCE
CMPI 200,A1
JRLS DIPL
MOVB @SWITCH+030H,A10
; SLL 24,A10
MOVI 060009EH,A1
MOVK 1,A2
CALLR DIPSUB
MOVB @SWITCH+038H,A10
; SLL 24,A10
MOVI 0600152H,A1
CALLR DIPSUB
MOVE A12,A12
JRN DIPL1
DEC A12
JRUC DIPL
DIPL1
MOVE @SWITCH,A0,L
BTST 20,A0
JREQ DIPL
RETS
DIPSUB
MOVK 8,A11
DIPTST1L
MOVI ROBO_BLACK,A3 ;ERASE OLD BUGGERS
MOVI DIPON,A0
CALLR STRNEW
MOVI DIPOFF,A0
CALLR STRNEW
MOVI ROBO_WHITE,A3
MOVI DIPON,A0
SRL 1,A10
JRNC DIPTST1
MOVI DIPOFF,A0
DIPTST1
CALLR STRNEW
SUBI 000EH,A1
DSJS A11,DIPTST1L
RETS
**************************************************************************
* *
* JOY_MESS *
* *
* PLOT THE STATUS OF A JOYSTICK AROUND A CIRCLE *
* *
* ENTRY *
* A9 CENTER OF STICK CIRCLE *
* A10 BUTTON MASK *
* A11 COLOR *
* *
* EXIT *
* NOTHING *
* *
**************************************************************************
JOY_MESS:
MOVI JJJTAB,A8
MOVK 4,A7
JML
MOVI ROBO_BLACK,A3
SRL 1,A10
JRNC JM1
MOVE A11,A3 ; SET COLOR
MOVK 1,A14
MOVE A14,@SCHANGE,W
JM1
MOVE *A8+,A0,L
MOVE A9,A1 ; CIRCLE CENTER
MOVB *A8,A2 ;X CORRECTION
ADDK 8,A8
ADD A2,A1
MOVB *A8,A2 ;Y CORRECTION
ADDK 8,A8
SLL 16,A2
ADD A2,A1
CLR A2 ; DIRECTION
CALLR STRNEW
DSJS A7,JML
RETS
*
*JOYSTICK MESSAGE TABLE
*
JJJTAB
.LONG UPMESS
.BYTE -7,-27
.LONG DOWNMESS
.BYTE -20,20
.LONG LEFTMESS
.BYTE -48,-5
.LONG RIGHTMESS
.BYTE 20,-5
**************************************************************************
* *
* BUT_PLOT *
* *
* PLOT A BUTTON TABLE ON THE SCREEN *
* *
* ENTRY *
* A9 POINTS TO BUTTON TABLE LIST *
* A10 SETTINGS OF THE SWITCH REGISTER *
* *
* EXIT *
* NOTHING *
* *
**************************************************************************
BUT_PLOT:
MOVE *A9,A1,L ; XY LOC
JRZ BPDONE
ADDI 32,A9
MOVE *A9,A0,W ; RADIUS
ADDI 16,A9
MOVE *A9,A6,L ; COLOR
ADDI 32,A9
MOVE *A9,A11,L ; GET MASK
ADDI 32,A9 ; MASK
ADDI 16,A9 ; SHIFT COUNT
MOVE *A9,A8,W ; JAMMA EXTEND-O-BIT
JRZ BPLOW
MOVE @SWSET2,A10,L
JRUC BPAND
BPLOW
MOVE @SWSET1,A10,L
BPAND
ADDI 16,A9