forked from historicalsource/smashtv
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ROBO.ASM
3540 lines (3306 loc) · 66.2 KB
/
ROBO.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
.FILE "ROBO.ASM"
;MENU
; MESS_MAC RD7FONT,SPACING20,200,137,ROBO_WHITE,STRCNRM,0
; .STRING "JON HEY "
; .BYTE 0,1
; MESS_MAC RD7FONT,SPACING20,200,147,ROBO_RED,STRCNRM,0
; .STRING "KEVIN WELSH "
; .BYTE 0,1
; MESS_MAC RD7FONT,SPACING20,200,157,ROBO_RED,STRCNRM,0
; .STRING "CHARLES OGDEN "
; .BYTE 0,0
.TITLE "ROBO-RAMA GAME PROGRAM"
.WIDTH 132
.OPTION B,D,L,T
.MNOLIST
;
; INITIATED: APRIL 13,1989
; MODIFIED: !
; SOFTWARE: MARK TURMELL
;
; COPYRIGHT (C) 1989 WILLIAMS ELECTRONICS GAMES, INC.
;
;
; GET THE SYSTEM STUFF
.INCLUDE "MPROC.EQU" ;MPROC EQUATES
.INCLUDE "DISP.EQU" ;DISPLAY PROC. EQUATES
.include "gsp.inc" ;gsp assembler equates
.include "sys.inc" ;z unit system equates
.include "macros.hdr" ;macros definitions
.INCLUDE "IMGTBL.GLO"
.INCLUDE "ROBO.EQU"
.INCLUDE "AUDIT.EQU"
;
;SOUNDS EXTERNAL
;
.REF MUSICOFF,SNDPRC,UGH,EXP3,CROWD2,YAMOFF,SHKSND,MCSPK9
;
;SYMBOLS EXTERNALLY DEFINED
;
;JARVIS
.REF FACCHECK,BONUS_WARP
.REF ADD_DUMP,GET_AUD,DEF_PAGE,GET_ADJ,GET_WVADDR
.REF SPAWN_ORB,ONSCRN_ORB,FLATFACE,O_FACE,MAXGAL,GAL_CNT
.REF ORB_DN,ORB_CNT,MAXORB,FACEON,SPWN_GAL3,SPWN_GAL1
.REF SPWN_GAL1A,SPWN_GAL2,O_COB,GALTYP,COLCYC,INIT_TAB
.REF STORE_AUDIT
.REF SCRADD2,POWERTST
.REF SPWN_SNK,SNK_DN,AUD1,MAXTNK,ROBTYP
.REF SPWN_RBTA,O_RBTA,RBTA_DN,MAXRBTA,RBTA_CNT,MUTPTR
.REF ADPCS3,OVALBLD,EXPMINE,SWAPSK,WNTOUT,O_ITEMS,PZON
.REF O_MUT,SCRIPTPLAY,ADJSTWTL,MTR1CNT,O_MINE,BLDOFF
.REF RNG_LIT,RNG_LIT2,PCTOT,TOID_ON,CIRCUIT,TWOCHNKS,CHNKS2
.REF KILLP1,KILLP2,CNTDIG1,CNTDIG2,GAMEOVER,LSHIT
.REF FIRE_DIRECTION,ATSTRT,STRT_WPN,MAXHULK,DELPAL
.REF BLT_CNT,MAXBLT,DO_BND,WAVEYX,STATUS2,MSG_PROC2
.REF SPAWN_HULKS,HULK_DN,MAXFAT
.REF ONSCRN_HULKS,ONSCRN_FAT
.REF BEGINOBJ,GETANIX
.REF ONSCRN_TNK,SPAWN_TNK,SPAWN_FAT,FAT_CNT
.REF JOYSW,SCRCLR,INIT_ALL,SHK_ON
.REF CLSCRACH,RANDOM
.REF FRANIM,GPALOBJ,B_DIR,BEGINOBJ2
.REF COLLISIONS
.REF BOSSON,WDOGRAM
.REF P1CTRL,P2CTRL,P1DATA,P2DATA,GAMSTATE,WAVE,GETFPAL
.REF JOY_UPDATE,UNSTACK,PSTAT,FIXMETERS,FIXMETERS2
.REF KILBGND,AUTOEOFF,AUTOEON,HALT,OBJON,OBJOFF
.REF HULK_CNT,LIVECNT
.REF WORLDTLX,WORLDTLY
.REF KP_LS,KP_RS,KP_TS
.REF TNK_CNT,TNK_DN,SHORT_PLYR,PCNT,SHORT2
.REF ONSCRN_WLMN
;
;SYMBOLS DEFINED IN THIS FILE
;
.DEF MAINLP
.DEF RINGTIME,MAXFREE,TANKDIFF,GRUNTMOD,COBRAKIL
.DEF TANKDIFF2,SETDIFF,TNKHITS,FATHITS
.DEF DRAW_PLYR_TORSO,RINGS,OFFRNG,ENDON,OVERLAP
.DEF INIT_PROG,ZEROCNTS
.DEF KEEPXY
.DEF RAMXY,WAVE_RAM,INIT_RAM
.DEF XYSEEK,XYSKOBJ,GETADIR,GETADIR2,XYSEEK2
.DEF CPULEFT,CPUAVG
.DEF WARMSET,EHALT
.DEF KILL_PLYR
.DEF KEEP_TOPL_GATE,KEEP_TOPR_GATE,KEEP_LFT_GATE,KEEP_RGT_GATE
.DEF OVERLORD,ECON,ENON
.DEF PLYRPRCS,PLYROBJS
MAX_ONSC .EQU 50
;
;UNINITIALIZED RAM DEFINITIONS
;
.BSS BOGUS,64
.BSS PAL1,16*16*2 ;ALLOCATE 2 X COLOR AREA IN RAM
.BSS PLYROBJS,64 ;2 ENTRIES-PLYR1,PLYR2 TORSO PTR
.BSS ECON,8 ;0=NO ENEMY TO ENEMY COLLIDE, 1=YES
.BSS ENON,8 ;0=NO ENEMY TO NEUTRAL COLLIDE, 1=YES
.BSS ENDON,8 ;0=OK TO FIRE,1=NO FIRE STICK
.BSS INXT,8
.BSS EHALT,16
.BSS KEEPXY,32
.BSS KEEP_LFT_GATE,32
.BSS KEEP_RGT_GATE,32
.BSS KEEP_TOPL_GATE,32
.BSS KEEP_TOPR_GATE,32
.BSS CPULEFT,16
.BSS CPUAVG,16
.BSS RAMXY,32*MAX_ONSC
.BSS WAVE_RAM,6*16*10 ;6=ELEMENTS,16=WORD SIZE
.BSS PLYRPRCS,64 ;2 ENTRIES-PLYR1,PLYR2 PROCESS PTR
;10 IS MAX TYPES PER WAVE
.BSS RINGTIME,16
.BSS MAXFREE,16
.BSS GRUNTMOD,16
.BSS TANKDIFF,16
.BSS TANKDIFF2,16
.BSS COBRAKIL,16
.BSS TNKHITS,16
.BSS FATHITS,16
;
;EQUATES FOR THIS FILE
;
VNORMVEL .EQU 016000H
HNORMVEL .EQU 016000H
VSLOVEL .EQU 0FA00H ;VNORMVEL*.707
HSLOVEL .EQU 0FA00H ;HNORMVEL*.707
;
VNORMVEL2 .EQU 01F000H
HNORMVEL2 .EQU 01F000H
VSLOVEL2 .EQU 018000H ;VNORMVEL*.707
HSLOVEL2 .EQU 018000H ;HNORMVEL*.707
;
;
.TEXT
INIT_PROG:
DINT ;DISABLE INTERRUPTS
;
; SET FIELD PARAMETERS
SETF 16,1,0 ;WORD SIGN EXTEND (FIELD 0)
SETF 32,1,1 ;LONG WORD (FIELD 1)
; SET THE STACK POINTER TO THE END OF SCRATCHPAD
MOVI STCKST,SP,L ;MOVE STACK ADDR IN SP (32 BITS)
MOVE @WDOGRAM,A0,L ;MARK SYSTEM AS INITIALIZED
CMPI WDOGNUM,A0
JRNZ WARMSET0
MOVI AUDLOCK,A0
CALLA AUD1
;DUMP REPORT OF WATCHDOG
.IF DEBUG
.ELSE
CALLERR 11,0
.ENDIF
;JUMP TO RECOVER CODE
MOVI AUDSTAT,A0
CALLA GET_AUD
MOVE A1,A1
JREQ WARMSET ;ATTRACT MODE GLITCH
CLR A1
CALLA STORE_AUDIT ;WARP ONLY ONCE, DUDE!!!
JAUC BONUS_WARP
WARMSET0:
JAUC POWERTST
WARMSET:
DINT ;DISABLE INTERRUPTS
;
; SET FIELD PARAMETERS
SETF 16,1,0 ;WORD SIGN EXTEND (FIELD 0)
SETF 32,1,1 ;LONG WORD (FIELD 1)
; SET THE STACK POINTER TO THE END OF SCRATCHPAD
MOVI STCKST,SP,L ;MOVE STACK ADDR IN SP (32 BITS)
; RESET TODAYS HIGH SCORE TABLE
CALLA INIT_TAB
; CLEAR SCRATCHPAD, INITIALIZE PROCESSES
CALLA CLSCRACH ;CLR SCRATCH RAM
CALLA INIT_ALL ;INITIALIZE Z-UNIT
MAIN0
CREATE 0,FACCHECK ;START ATTRACT IF THINGS O.K.
; CALLA ATSTRT ;START ATTRACT MODE
CREATE PLIST_ID,UNSTACK ;CREATE SWITCH UNSTACKER
;
; MAIN LINE LOGIC LOOP
;
MAINLP:
CALLA PRCDSP ;DISPATCH PROCESSES
MOVE A13,A13
JRZ MAINPOK
.IF DEBUG
LOCKUP
EINT
.ELSE
CALLERR 10,0
.ENDIF
;
***********************************************
MAINPOK:
CALLA SNDPRC ;DISPATCH AND TIME THE SOUND CALLS
CALLA RANDOM ;NEW SEED PLEASE
; CALLA COINIRQ ;COIN SWITCH INTERRUPT
.IF DEBUG
callr StCpuLft
.ENDIF
***********************************************************
******test rom protect interrupt
.IF DEBUG
JRUC SKIPCK
dint
MOVE @INTENB,A0,0 ;ENABLE ROM PROTECT INTERRUPT (ext2)
ORI X2E,A0
MOVE A0,@INTENB,0
eint
move @0ffe00000H,a0,0
move a0,@0ffe00000H,0
SKIPCK
.ENDIF
**************************************************************
****************************************************************
MOVB @PCNT,A0
DEC A0
MOVB A0,@PCNT
MOVE @GAMSTATE,A0
CMPI INDIAG,A0
JRNZ NODIAG
MOVI AMDEPID,A0
CLR A1
NOT A1
CALLA KILALL
CALLA KILBGND
NODIAG:
JRUC MAINLP
;
SETDIFF
;BASED ON CMOS DIFFICULTY SETTING, (0-9) STUFF SEVERAL DIFFERENT
;RAM LOCATIONS THAT IMPACT GAME DIFFICULTY. THESE RAM LOCATIONS
;ARE REFERENCED BY ENEMIES IN EACH FILE.
;SETDIFF IS CALLED AT THE START OF A GAME AND WHENEVER WE WISH TO
;MODIFY OVERALL GAME DIFFICULTY.
;ITEMS AFFECTED:
;FREEMEN POSSIBLE PER CIRCUIT @MAXFREE
;MODIFY # GRUNTS ON SCREEN (+/-) @GRUNTMOD
;TANK FIRE RATE @TANKDIFF
;TIME RINGS ARE AROUND PLAYER (+/-) @RINGTIME
MOVI ADJDIFF,A0
CALLA GET_ADJ
;A0=0-9 DIFFICULTY LEVEL!
MOVE A0,A8
; SLL 4,A0
; ADDI LASERTBL,A0
; MOVE *A0,A0,W
; MOVE A0,@LASERSPD
;
; MOVE A8,A0
SLL 4,A0
ADDI FREETBL,A0
MOVE *A0,A0,W
MOVE A0,@MAXFREE
;
MOVE A8,A0
SLL 4,A0
ADDI GRUNTTBL,A0
MOVE *A0,A0,W
MOVE A0,@GRUNTMOD
;
MOVE A8,A0
SLL 4,A0
ADDI TANKTBL,A0
MOVE *A0,A0,W
MOVE A0,@TANKDIFF
;
MOVE A8,A0
SLL 4,A0
ADDI TANKTBL2,A0
MOVE *A0,A0,W
MOVE A0,@TANKDIFF2
;
MOVE A8,A0
SLL 4,A0
ADDI RINGTBL,A0
MOVE *A0,A0,W
MOVE A0,@RINGTIME
;
MOVE A8,A0
SLL 4,A0
ADDI WNDTBL,A0
MOVE *A0,A0,W
MOVE A0,@COBRAKIL
;
MOVE A8,A0
SLL 4,A0
ADDI HITFAT,A0
MOVE *A0,A0,W
MOVE A0,@FATHITS
;
MOVE A8,A0
SLL 4,A0
ADDI HITTNKS,A0
MOVE *A0,A0,W
MOVE A0,@TNKHITS
;
;ADD MORE DIFFICULTY SETTINGS HERE
RETS
HITTNKS .WORD 3,6,12,17,20,25,30,35,45,50,50
HITFAT .WORD 1,3,6,8,9,10,12,15,18,20,20
;LASERTBL
; .WORD 3,3,3,3,3,3,3,3,3,3,3
FREETBL
.WORD 4,4,3,2,2,2,1,1,0,0,0
GRUNTTBL
.WORD -4,-3,-2,-1,0,0,1,3,4,6,6
; .WORD -7,-7,-5,-5,-4,-4,-3,-1,2,4,4 ;GERMAN VERSION
TANKTBL
.WORD -3,-2,-1,-1,0,0,1,2,3,4,4
TANKTBL2
.WORD 12,11,10,9,8,8,7,6,5,4,4
RINGTBL
.WORD 700,600,500,400,300,300,300,200,150,110,110
WNDTBL
.WORD 1000-100,1500-100,2500-100,3000-100,3500-100,3900-100
.WORD 4000-100,4500-100,5000-100,5000-100,5000-100
INIT_RAM:
CLR A0
MOVE A0,@HULK_DN
MOVE A0,@ORB_DN
MOVE A0,@TNK_DN
MOVE A0,@RBTA_DN
MOVE A0,@SNK_DN
MOVB A0,@KP_LS
MOVB A0,@KP_RS
MOVB A0,@KP_TS
MOVB A0,@SHK_ON
MOVB A0,@FACEON
MOVB A0,@BOSSON
MOVB A0,@TOID_ON
MOVB A0,@WNTOUT
MOVB A0,@PCTOT ;CAREFUL!!
MOVB A0,@PZON
MOVB A0,@ENDON
RETS
;
RINGS:
;A10=TIME RINGS ARE ON
;A9=PLAYER NUMBER 1/2 TO RING
;TURN OFF EXISTING RINGS AROUND THIS PLAYER PLUS ITS COLOR CYCLE
MOVB A9,*A13(MYPLYR)
;SET BOUNDARIES TO ORBITING TYPE BNDRY
;SET BOUNDARIES FOR CORRECT PLAYER!
DEC A9
MOVE A10,*A13(TIME)
SLL 5,A9
MOVE A9,A10
JRZ X1
CREATE RCYC2PID,RNG_LIT2
JRUC X2
X1
CREATE RCYC1PID,RNG_LIT ;CYCLE NUP1 PAL
X2 ADDI PLYRPRCS,A9
MOVE *A9,A9,L
MOVK 1,A0 ;HELPER TYPE BOUNDARY FOR RING IMAGE
MOVB A0,*A9(BNDTYP)
MOVE A9,A7 ;DO_BND NEEDS PROC PTR IN A7
CALLA DO_BND
MOVI PLYROBJS,A9
ADD A10,A9
MOVE *A9,A8,L
MOVE A8,A11 ;KEEP PLAYER OBJ TO RING IN A11
CALLA GETANIXY
CLR A6
CLR A7
MOVE A2,A1
MOVE A3,A0
MOVI 140,A3 ;HIGHER PRIORITY THAN PLAYER
MOVI DMAWNZ,A4
MOVI CLSPLYR|TYPPLYR|SUBRNG1,A5
MOVI SHLD1,A2
CALLA BEGINOBJ2
MOVE A8,A9 ;CIRCLE IMAGE
MOVE A10,A10
JRZ RTP
;CHANGE TO NUP2 PAL
MOVI nup2,A0
CALLA GETFPAL ;GET A COLOR MAP ASSIGNMENT
MOVE A0,*A8(OPAL),W ;STORE THE NEW PALETTE
RTP
MOVE @HALT,A0
JRNE RG
MOVE *A13(TIME),A0
DEC A0
MOVE A0,*A13(TIME)
JRZ KRNGS
CMPI 100,A0
JRNE NYTB
MOVE A10,A10
JRNE F1
CREATE B1PID,BLINK ;BLINK OUT RING PROCESS
MOVI RCYC1PID,A0
CLR A1
NOT A1
CALLA KILALL
;STUFF RED INTO NUP1 PALL
JRUC NYTB
F1
CREATE B2PID,BLINK
MOVI RCYC2PID,A0
CLR A1
NOT A1
CALLA KILALL
;STUFF RED INTO NUP2 PALL
NYTB MOVE *A11(OPLINK),A0,L
MOVI 40,A1 ;10
MOVE A1,*A0(DELYDET) ;KEEP STUFFING A VALUE IN HERE
MOVE A9,A0
MOVE A11,A8
CALLA GETANIXY
ADDI 0300000H,A2
MOVE *A0(OFLAGS),A4,W
CALLA GANISAG
MOVE A0,A9
RG SLEEP 1
JRUC RTP
OFFRNG
;MOVE PLAYER WITH RINGS AWAY FROM MUTOID BOSS ENEMY
;A0=PLAYER RING IMAGE
MMTM SP,A0,A1,A2,A3,A4,A5,A6
MOVE *A0(OPLINK),A0,L
MOVE @MUTPTR,A3,L
MOVE *A3(PDATA),A3,L ;TNKL
MOVE *A3(OXPOS),A2
MOVE *A3(OYPOS),A3
ADDI 20,A2
ADDI 20,A3
MOVB *A0(MYPLYR),A1
DEC A1
SLL 5,A1
ADDI PLYRPRCS,A1
MOVE *A1,A1,L
MOVE *A1(TSO_PTR),A5,L
MOVE *A1(LEG2_PTR),A1,L
MOVE *A1(OXPOS),A4
MOVE *A5(OXPOS),A6
CMP A4,A2
JRGT GONEG
;ADD TO PLYR X
ADDI 3,A4
ADDI 3,A6
JRUC GOGO
GONEG
SUBI 3,A4
SUBI 3,A6
GOGO MOVE A4,*A1(OXPOS)
MOVE A6,*A5(OXPOS)
MOVE *A1(OYPOS),A4
MOVE *A5(OYPOS),A6
CMPI 182H,A4
JRLT GOGO2
CMP A4,A3
JRGT GONEG2
;ADD TO PLYR Y
ADDI 3,A4
ADDI 3,A6
JRUC GOGO1
GONEG2 SUBI 3,A4
SUBI 3,A6
GOGO1 MOVE A4,*A1(OYPOS)
MOVE A6,*A5(OYPOS)
;CALLED FROM COLLISION ROUTINE
;RESET HERE
; MOVI KRNGS,A7
; CALLA PUTA7
GOGO2
MMFM SP,A0,A1,A2,A3,A4,A5,A6
RETS
;KILL RINGS OFF
KRNGS MOVE A9,A0
; CALLA DELPAL ;NEEDED? NOT IF IN PLYR PAL!
CALLA DELOBJ
CLR A1
NOT A1
MOVI B1PID,A0
;A10=0 IF PLAYER 1
MOVE A10,A10
JREQ KL
MOVI B2PID,A0
KL CALLA KILALL
;CHANGE BOUNDARY FOR CORRECT PLAYER!
MOVI PLYRPRCS,A7
ADD A10,A7
MOVE *A7,A7,L
MOVE *A7(LSRPTR),A0,L
JRNZ D ;BR=LASER IS AROUND THIS PLAYER
MOVB *A7(BNDTYP),A0
CMPI 1,A0
JRNE D
CLR A0
MOVB A0,*A7(BNDTYP)
MOVB A0,*A7(PRVBND)
CALLA DO_BND
D
DIE
BLINK
;BLINK OUT RING
;A9=RING IMAGE TO BLINK
MOVE *A9(OFLAGS),A4,W
MOVI FRNTBK,A1
MOVE A9,A8
CALLA ANI
BKZ
MOVE A9,A0
CALLA OBJOFF
SLEEP 5
MOVE A9,A0
CALLA OBJON
SLEEP 5
JRUC BKZ
SETMAX:
MOVK 5,A0
MOVB A0,@MAXFAT
CLR A0
MOVE A0,@GALTYP
MOVE @CIRCUIT,A0
JRZ SET0
CMPI 1,A0
JRZ DOC1
;3RD CIRCUIT
MOVE @WAVE,A0
SLL 3,A0
ADDI RMAX2,A0
MOVB *A0,A0
MOVK 5,A1
CALLR ONEPADJ
CALLR ADJMAX
MOVB A0,@MAXRBTA
MOVE @WAVE,A0
SLL 3,A0
ADDI OMAX,A0
MOVB *A0,A0
MOVK 2,A1
CALLR ONEPADJ
MOVB A0,@MAXORB
MOVE @WAVE,A0
SLL 3,A0
ADDI RTYPT,A0
MOVB *A0,A0
MOVE A0,@ROBTYP
MOVE @WAVE,A0
SLL 3,A0
ADDI GTYPT,A0
MOVB *A0,A0
MOVE A0,@GALTYP
JRZ SETG
MOVI SPDRP,A8 ;PAL NAME
MOVI PAL1,A9 ;RAM AREA
MOVI [32,45],A10 ;BEGIN/END COLOR #
MOVK 3,A11 ;RATE IN TICKS
CREATE CYCPID,COLCYC ;COLOR CYCLER ON
SETG MOVE @WAVE,A0
SLL 3,A0
ADDI GMAX2,A0
MOVB *A0,A0
MOVK 2,A1
CALLR ONEPADJ
MOVB A0,@MAXGAL
MOVE @WAVE,A0
SLL 3,A0
ADDI HMAX2,A0
MOVB *A0,A0
MOVK 5,A1
CALLR ONEPADJ
CALLR ADJMAX
MOVB A0,@MAXHULK
MOVK 3,A0
MOVE @WAVE,A1
CMPI 1,A1
JRZ RTF
INC A0
CMPI 11,A1
JRZ RTF
MOVK 1,A0
RTF
MOVB A0,@MAXTNK
RETS
ONEPADJ
MOVE @STATUS2,A2
CMPI 3,A2
JRZ TWEEK1
SUB A1,A0
TWEEK1
RETS
DOC1
;SET CIRCUIT 2
MOVE @WAVE,A0
SLL 3,A0
ADDI RTYPT,A0
MOVB *A0,A0
MOVE A0,@ROBTYP
MOVE @WAVE,A0
SLL 3,A0
ADDI RMAX,A0
MOVB *A0,A0
MOVK 2,A1
CALLR ONEPADJ
CALLR ADJMAX
MOVB A0,@MAXRBTA
MOVE @WAVE,A0
SLL 3,A0
ADDI OMAX,A0
MOVB *A0,A0
MOVB A0,@MAXORB
MOVE @WAVE,A0
SLL 3,A0
ADDI GMAX,A0
MOVB *A0,A0
MOVK 2,A1
CALLR ONEPADJ
MOVB A0,@MAXGAL
MOVK 5,A0
MOVB A0,@MAXFAT
MOVK 1,A0
MOVB A0,@MAXTNK
RETS
ADJMAX
MOVE @GRUNTMOD,A2
ADD A2,A0
RETS
SET0 ;CIRCUIT 1
MOVE @WAVE,A0
SLL 3,A0
ADDI HMAX,A0
MOVB *A0,A0
CALLR ADJMAX
MOVB A0,@MAXHULK
MOVE @WAVE,A0
SLL 3,A0
ADDI TMAX,A0
MOVB *A0,A0
MOVB A0,@MAXTNK
MOVE @WAVE,A0
SLL 3,A0
ADDI FMAX,A0
MOVB *A0,A0
MOVB A0,@MAXFAT
RETS
GTYPT .BYTE 0,1,1,0,1,0,1,0,1,1,0,0,0,1,1,1,1,1,1,0,0,0,0
RTYPT .BYTE 0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,1,0,1,0,0,0,0
HMAX .BYTE 2,12,11,25,32,20,20,25,29,24,32,32 ;CIRCUIT 1
TMAX .BYTE 1,1,1,1,1,1,1,1,1,1,1,1 ;CIRCUIT 1
FMAX .BYTE 2,3,3,2,7,10,6,6,11,8,5 ;CIRCUIT 1
;JARVIS
OMAX .BYTE 2,20,20,25,25,25,13,25,25,25,25
.BYTE 25,25,25,25,25,25,25,25,25 ;CIRCUIT 2 (ORBS)
.BYTE 25,25,25,25
RMAX .BYTE 2,10-2,22-2,25-2,20-2,20-2,20-2,20-2,19-4,15-2,20-2
.BYTE 22-7,25-2,20-2,20-2,20-2,23-2,18-2,20-2,20-2 ;CIRCUIT 2 (ROBOTS)
.BYTE 25,25,25,25
RMAX2 .BYTE 2,10-2,22-2,25-2,20-2,32,20-2,20-2,19-4,15-2,20-2
.BYTE 22-7,25-2,20-2,20-2,23,24,18-2,20-2,26 ;CIRCUIT 2 (ROBOTS)
.BYTE 25,25,25,25
GMAX .BYTE 2,20,20,20,20,12,7,25,13,25,25
.BYTE 22-6,25,4,5,25,12,25,22,25 ;CIRCUIT 2 (GALS)
GMAX2 .BYTE 2,8,10,10,10,12,7,15,13,15,15
.BYTE 22-6,15,4,5,8,12,15,12,15 ;CIRCUIT 3 (GALS)
.BYTE 22-6,15 ;CIRCUIT 3 (GALS)
SMAX .BYTE 2,20,20,20,20,12,7,25,13,25,25
.BYTE 22-4,25,4,5,25,12,25,22,25 ;CIRCUIT 3 (SNKS)
HMAX2 .BYTE 2,15,15,29,32,20,26,25,23,24,32 ;CIRCUIT 3 GRUNTS
.BYTE 28,25,21,25,25,22,25,29,25 ;CIRCUIT 3
.BYTE 30,25 ;CIRCUIT 3
.EVEN
TYP_TBL: ;FOR ONSCREEN
.LONG 0,ONSCRN_ORB,ONSCRN_TNK,ONSCRN_FAT,ONSCRN_WLMN
.LONG ONSCRN_HULKS,O_MINE,O_MUT,O_FACE,O_RBTA,0,0,0,0,O_COB
.LONG 0
TYP_TBL2: ;FOR SPAWNING
.LONG 0,SPAWN_ORB,SPAWN_TNK,SPAWN_FAT,NO
.LONG SPAWN_HULKS,NO,NO,NO,SPWN_RBTA,SPWN_GAL3,SPWN_GAL1,SPWN_GAL1A
.LONG SPWN_GAL2,NO,SPWN_SNK
NO RETS
CQWAVE .LONG WAVE_INFO,W2_INFO,W3_INFO
WAVE_INFO:
;RECORDS LOOK LIKE THIS
;TYPES:DIFFERENT ID'S
;#:TOTAL NUMBER PER WAVE
;DIFFICULTY:0,1,2,3 0=EASIEST
;RATE:# OF CYCLES/3 (SLP CNTR) BEFORE SPAWN IS CALLED
;ONSCRN:# OF TYPE ON SCREEN AT START OF WAVE
;CNTR USED IN WAVE RAM UPDATING
;RECORD LAYOUT
;TYPE # LEVEL RATE ONSCRN CNTR
;WAVE 1
.WORD HULK,100,0,6,4,30 ;110
.WORD TANK,5,0,90,0,1320
.WORD 0
;WAVE 2
.WORD HULK,195,1,1,0,1
.WORD FAT,6,0,160,0,50
.WORD MINE,3,0,0,3,1
.WORD TANK,5,0,140,0,1420
.WORD 0
;WAVE 3
.WORD HULK,335,2,8,16,1
.WORD FAT,15,0,90,2,30
.WORD MINE,5,0,0,5,1
.WORD WLMN,1,0,0,1,1
.WORD TANK,5,0,90,0,1720
.WORD 0
;WAVE 4
.WORD HULK,25,3,1,0,410
.WORD FAT,30,0,5,7,40
.WORD WLMN,2,0,0,2,1
.WORD MINE,5,0,0,5,1
.WORD TANK,5,0,90,0,1720
.WORD 0
;WAVE 5
;CASH ROOM
.WORD HULK,455,6,4,0,120
.WORD FAT,25,0,80,0,400
.WORD MINE,5,0,0,5,1
.WORD TANK,2,0,140,0,1800
.WORD 0
;WAVE 6
.WORD HULK,35,3,1,16,500
.WORD GALS3,1,0,190,0,1 ;SWARMER DUDES
.WORD FAT,15,0,60,3,70
.WORD MINE,2,0,0,2,1 ;5
.WORD TANK,5,0,240,0,1220 ;1820
.WORD 0
;WAVE 7
.WORD HULK,395,3,1,16,1
.WORD GALS3,1,0,250,0,1300 ;SWARMER DUDES
.WORD MINE,3,0,0,3,1
.WORD FAT,13,0,115,2,1
.WORD TANK,5,0,140,0,1620
.WORD 0
;WAVE 8 ;WALL MEN
.WORD HULK,295,4,1,0,160 ;COULD ENTER FROM MULTIPLE DOORS!
;DO NOT HAVE ANY ON SCREEN!
.WORD GALS3,1,0,500,0,1 ;SWARMER DUDES
.WORD FAT,10,0,10,3,1
.WORD WLMN,2,0,0,2,1
.WORD MINE,5,0,0,5,1
.WORD TANK,13,0,40,0,700 ;8
.WORD 0
;WAVE 9 ;WALL MEN
.WORD HULK,325,4,1,0,1 ;COULD ENTER FROM MULTIPLE DOORS!
;DO NOT HAVE ANY ON SCREEN!
.WORD WLMN,2,0,0,2,1
.WORD TANK,17,0,160,0,1 ;200
.WORD FAT,8,0,1,3,300
.WORD MINE,4,0,0,4,1
.WORD 0
;WAVE 10
;MUTOID MAN
.WORD MUTD,0,0,07FFFH,1,1
.WORD MINE,2,0,0,2,1
.WORD GALS3,1,0,45,0,20 ;SWARMER DUDES
.WORD FAT,35,0,140,0,1000 ;1000 / 200
.WORD 0
W2_INFO:
;TYPE # LEVEL RATE ONSCRN CNTR
;WAVE 1
.WORD ORB,98,0,10,1,1 ;STUFF IN CORNER!
; .WORD RBTA,350,3,1,0,1
.WORD 0
;WAVE 2
.WORD RBTA,380,3,1,0,1
.WORD FAT,1,0,90,1,500
.WORD 0
;WAVE 3
.WORD RBTA,270,5,5,3,850
.WORD GALS3,2,0,80,0,1 ;SWARMER DUDES
.WORD MINE,3,0,0,3,1
.WORD GALS1A,15,0,10,0,150 ;TRAIN
.WORD 0
;WAVE 4
.WORD GALS3,1,0,70,0,1 ;SWARMER DUDES
.WORD RBTA,240,4,1,0,800
.WORD MINE,4,0,0,4,1
.WORD GALS1,60,0,15,0,1 ;GALAGA TRAIN HEAD ENEMY
.WORD 0
;WAVE 5
.WORD RBTA,330,7,1,0,720
.WORD GALS1,40,0,8,0,181 ;GALAGA TRAIN HEAD ENEMY
.WORD FAT,10,0,190,1,500
.WORD MINE,4,0,0,4,1
.WORD GALS3,4,0,75,0,1 ;SWARMER DUDES
.WORD TANK,6,0,60,1,1200
.WORD 0
;WAVE 6
.WORD ORB,90,0,8,1,400 ;
.WORD GALS2,35,0,15,0,1 ;PURPLE GALAGA
.WORD MINE,4,0,0,4,1
.WORD TANK,13,0,50,1,1
.WORD 0
;WAVE 7
;FLAT FACE ;MONITOR OUT
.WORD FACE,0,0,07FFFH,1,1
.WORD MINE,5,0,0,5,1
.WORD 0
;WAVE 8
.WORD RBTA,180,3,1,0,800
.WORD GALS1A,16,0,10,0,10 ;GALAGA TRAIN
.WORD MINE,3,0,0,3,1
.WORD 0
;WAVE 9 ;MONITOR OUT
;TYPE # LEVEL RATE ONSCRN CNTR
.WORD RBTA,290,7,1,0,130
.WORD GALS3,4,0,80,0,1 ;SWARMER DUDES
; .WORD TANK,4,0,140,1,1
.WORD MINE,5,0,0,5,1
.WORD 0
;WAVE 10
.WORD RBTA,100,4,1,5,1 ;BOGUS WAVE NEVER SEEN!
.WORD 0
;WAVE 11
.WORD RBTA,360,5,1,0,890 ;JUNK ON FLOOR
.WORD GALS1A,16,0,10,0,1 ;TRAIN
.WORD 0
;WAVE 12
;MONITOR OUT
; .WORD ORB,88,0,8,1,120 ;CASH ROOM
.WORD RBTA,550,4,1,0,150
.WORD MINE,5,0,0,5,1
.WORD FAT,17,0,70,0,500
.WORD 0
;WAVE 13
.WORD GALS2,24,0,4,0,10 ;PURPLE GALAGA
.WORD RBTA,350,4,5,0,350
.WORD MINE,3,0,0,3,1
.WORD 0
;WAVE 14 ;MONITOR OUT
.WORD RBTA,380,5,4,0,150 ;CASH ROOM
.WORD GALS1A,3,0,180,0,500 ;TRAIN GALAGA
.WORD FAT,9,0,10,0,1000
.WORD MINE,5,0,0,5,1
.WORD TANK,3,0,190,0,900
.WORD 0
;WAVE 15
.WORD ORB,90,0,8,1,1
.WORD MINE,5,0,0,5,1
.WORD TANK,8,0,190,1,1
.WORD 0
;WAVE 16
.WORD RBTA,350,7,1,0,720
.WORD GALS1,40,0,7,0,181 ;GALAGA TRAIN HEAD ENEMY
.WORD FAT,10,0,190,1,500
.WORD MINE,4,0,0,4,1
.WORD GALS3,4,0,75,0,1 ;SWARMER DUDES
.WORD TANK,8,0,60,1,1200
.WORD 0
;WAVE 17
.WORD RBTA,550,7,1,0,1
.WORD 0
;WAVE 18
.WORD RBTA,690,7,1,0,1200
.WORD MINE,2,0,0,2,1
.WORD GALS3,9,0,80,0,1 ;SWARMER DUDES
.WORD GALS1A,15,0,10,0,520 ;TRAIN
; .WORD TANK,3,0,100,1,1700
.WORD GALS2,5,0,10,0,1090 ;PURPLE GALAGA
.WORD 0
;
;CIRCUIT 3 INFO
;
W3_INFO:
;TYPE # LEVEL RATE ONSCRN CNTR
;WAVE 1
.WORD HULK,12,2,1,8,900 ;SET HULKTYP
.WORD SNK,15,3,280,0,400
.WORD TANK,24,0,19,0,1
.WORD MINE,5,0,0,5,1
.WORD 0
;WAVE 2
.WORD HULK,315,2,8,3,350
.WORD SNK,335,3,80,0,1
.WORD GALS1A,6,0,50,0,50 ;GALAGA TRAIN
.WORD MINE,5,0,0,5,1
.WORD TANK,3,0,100,0,1500
.WORD 0
;WAVE 3 ;REGULAR GRUNTS
.WORD HULK,700,7,1,5,1
.WORD FAT,5,0,170,2,2100
.WORD SNK,235,0,290,0,1
.WORD MINE,3,0,0,3,1
.WORD TANK,3,0,100,0,2400
.WORD 0
;WAVE 4
.WORD HULK,650,7,1,5,1
.WORD MINE,3,0,0,3,1
.WORD FAT,17,0,70,4,500
.WORD 0
;WAVE 5
.WORD RBTA,400,6,4,0,1
.WORD MINE,8,0,0,8,1
.WORD 0
;WAVE 6
.WORD HULK,1040,6,1,1,800
.WORD GALS3,13,0,70,0,1 ;SWARMER DUDES
.WORD MINE,14,0,0,14,1
.WORD GALS1A,34,0,400,0,180 ;GALAGA TRAIN
.WORD 0
;WAVE 7
;SNAKES ;MONITOR OUT
.WORD COBRA,0,0,07FFFH,1,1
.WORD 0
;WAVE 8
.WORD HULK,700,5,2,5,1
.WORD SNK,835,3,80,0,20
.WORD MINE,6,0,0,6,1
.WORD 0
;WAVE 9 ;MONITOR OUT
.WORD HULK,650,6,1,0,1200
.WORD FAT,17,0,170,4,500
.WORD SNK,2835,3,25,0,50
.WORD MINE,5,0,0,5,1
.WORD 0
;WAVE 10 ;BOGUS WAVE NEVER SEEN
.WORD HULK,140,4,1,5,1
.WORD 0
;WAVE 11
.WORD HULK,9,2,1,5,1100 ;SET HULKTYP
.WORD TANK,25,0,15,1,1
.WORD MINE,5,0,0,5,1
.WORD 0
;WAVE 12 ;PRIZE ROOM
.WORD HULK,600,6,1,0,350
.WORD MINE,6,0,0,6,1
.WORD FAT,8,0,1,0,1400
.WORD GALS1A,4,0,50,0,180 ;GALAGA TRAIN
.WORD GALS3,5,0,280,0,700 ;SWARMER DUDES
.WORD 0
;WAVE 13
.WORD HULK,400,2,1,10,1
.WORD SNK,535,3,80,0,50