forked from historicalsource/smashtv
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSHOTS.ASM
3058 lines (2559 loc) · 48.7 KB
/
SHOTS.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 "SHOTS.ASM"
.TITLE "ROBO-RAMA GAME PROGRAM SHOTS STUFF"
.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 "sys.inc" ;z unit system equates
.include "macros.hdr" ;macros definitions
.INCLUDE "IMGTBL.GLO"
.INCLUDE "ROBO.EQU"
;
;SOUNDS EXTERNAL
;
.REF SCASH,GIFT,ICON,SHOT,MISS,EXP3,EXP1,TING,FREESND
.REF BUBL,RIFL,EXP3HI,FSHOT,PZLSND,GRNSND,ICSND
.REF WOO1,WOO2,BINGO,EXP3HIB
;
;SYMBOLS EXTERNALLY DEFINED
;
.REF SMRT_GAL,ZEROCNTS,RINGTIME,MCON,CNTDIG1
; .REF GAMSTATE
.REF FACEON,SCRADD2,FFLG,TOID_ON,CIRCUIT,GETFPAL,PCNT
.REF P1CSH,P2CSH,P1PZ1,P2PZ1,WNTOUT,KILL_OB
.REF SCORETYP,P2LVS,P1LVS,RFACEP,LFACEP,OBJOFF,OBJON
.REF METERP1,METERP2,STATUS2
.REF FRANIM,DELPAL,DRINF,BOOM2,WAVEYX
.REF RANGRAND,RINGS,SHAKER,KILL_H1,KILL_F2
.REF KEEP_TOPL_GATE,KEEP_TOPR_GATE,KILL_TK,KILL_TS
.REF RSIDEVW,LSIDEVW,KILL_CBALL,P1DATA,P2DATA
.REF LASRX,LASRY,FILLUP,METERS,SHK_ON
.REF KILL,XYSEEK2,KILL_R1,KILL_SK1
.REF ICNFLG,PZFLG,PZON,PRZ_LIT
;
;SYMBOLS DEFINED IN THIS FILE
;
.DEF SPRAYON,PODON,GRENON,KEYON,NSTPON,RINGON,SHOEON
.DEF FIRE_DIRECTION,BULL_EXP_LIST,SMRTON,KOFFC
.DEF BLT_CNT,MAXBLT,SMLEXP,BAD0
.DEF B_DIR,KILL_BULL,BLTDIR,STRT_WPN,REGEXP
.DEF MV_BULL,KILL_BULLT,TPZ1,TPZ2,TPZ3,TCSH,TITM
.DEF BOSSON,SENDCRNR
;
;UNINITIALIZED RAM DEFINITIONS
;
.BSS BOSSON,8
.BSS NXT_XVEL,32
.BSS NXT_YVEL,32
.BSS BLT_CNT,8 ;TOTAL BULLETS ACTIVE
.BSS B_DIR,16 ;BULLET DIRECTION 1-9 BUT NOT 3!
;
;EQUATES FIRST ORIGINATED IN THIS FILE
;
;PUT IN ANGLE VELOCITIES!
BLTYVEL .EQU 072000H ;0164000H
BLTXVEL .EQU 072000H ;0164000H
BLT5YVEL .EQU 038000H ;0164000H
BLT5XVEL .EQU 040000H ;0164000H
GRNYVEL .EQU 000H
GRNXVEL .EQU 2000H
;-18000 FOR FLATFACE
GRNYVEL2 .EQU -018000H
GRNXVEL2 .EQU -018000H
MAXBLT .EQU 45
.TEXT
;
TITM
;TOUCH CASH ON FLOOR
CLR A10
;CHANGE OID, RAISE ZPOS, SEND TOWARD P1/P2 TV MONITOR, SLEEP 2 SEC, KILL, DIE
MMTM SP,A1,A2,A3,A4,A5,A6,A7,A9
MOVI P1DATA,A2
PUSH A0
MOVE *A0(OPLINK),A0,L
MOVB *A0(PNUM),A1
CMPI 1,A1
JRZ TR5
MOVI P2DATA,A2
TR5
MOVI PZPT2,A1
CALLA SCRADD2
PULL A0
; MOVE @MCON,A1
; JRZ NOMC
; CALLR SEND2
; JRUC MC
;NOMC
CALLR SEND
;MC
CREATE FLYPID,KOFFC2
MMFM SP,A1,A2,A3,A4,A5,A6,A7,A9
RETS
TCSH:
;TOUCH CASH ON FLOOR
CLR A10
;CHANGE OID, RAISE ZPOS, SEND TOWARD P1/P2 TV MONITOR, SLEEP 2 SEC, KILL, DIE
MMTM SP,A1,A2,A3,A4,A5,A6,A7,A9
CALLR SEND
CREATE FLYPID,KOFFC
MMFM SP,A1,A2,A3,A4,A5,A6,A7,A9
RETS
;SEND2
; MOVE *A0(OPLINK),A0,L
; MOVB *A0(PNUM),A9 ;PLAYER 1 OR 2
; MOVI WOO1,A0 ;GET CASH PICKUP SND
; JRUC SEN2A
SEND
MOVE *A0(OPLINK),A0,L
MOVB *A0(PNUM),A9 ;PLAYER 1 OR 2
MOVI SCASH,A0 ;GET CASH PICKUP SND
;SEN2A
CALLA ONESND
SENDCRNR
MOVI CLSNEUT|TYPNEUT,A0
MOVE A0,*A8(OID)
MOVI DMAWNZ|M_NOCOLL,A0
MOVE A0,*A8(OFLAGS)
MOVI 200,A0
MOVE A0,*A8(OZPOS)
;
CLR A5
CLR A6
MOVE @WAVEYX,A0,L ;WAVE TL OFFSET
MOVY A0,A6 ;Y VALUE TO SCROLL TO IN A10
SRL 16,A6
ADDI 40,A6
MOVX A0,A5 ;X VALUE TO SCROLL TO IN A9
ADDI 30,A5
CMPI 1,A9
JREQ UPLC
;PLYR 2 TV SEEK
ADDI 340,A5
MOVE @MCON,A0
JRNZ UPLC2
MOVE @P2CSH,A0
INC A0
INC A0
MOVE A0,@P2CSH
JRUC UPLC2
UPLC
MOVE @MCON,A0
JRNZ UPLC2
MOVE @P1CSH,A0
INC A0
INC A0
MOVE A0,@P1CSH
UPLC2 CALLA XYSEEK2
MOVE A5,*A8(OXVEL),L
MOVE A6,*A8(OYVEL),L
RETS
;
KOFFC
MOVE @WAVEYX,A0,L ;WAVE TL OFFSET
MOVY A0,A11 ;Y VALUE TO SCROLL TO IN A10
SRL 16,A11
ADDI 35,A11
MOVI 18,A10 ;A10 IS TIMER
SLPC SLEEP 10
MOVE *A8(OYPOS),A0
CMP A0,A11
JRNC DNSLPC
DSJS A10,SLPC
DNSLPC
;DELETE FLOATING CASH IMAGE
MOVE A8,A0
CALLA DELOBJ
DIE
KOFFC2
MOVE A8,A0
MOVE *A0(OPLINK),A0,L
CALLA KILL
MOVE @WAVEYX,A0,L ;WAVE TL OFFSET
MOVY A0,A11 ;Y VALUE TO SCROLL TO IN A10
SRL 16,A11
ADDI 35,A11
MOVI 18,A10 ;A10 IS TIMER
LPC SLEEP 10
MOVE *A8(OYPOS),A0
CMP A0,A11
JRNC NSLPC
DSJS A10,LPC
NSLPC
;HAS REACHED TOP
;KILL PRIZE, REMOVE FACE, REMOVE LIVES, PLACE GIFT PICTURE, START COLOR CYCLE
;REMOVE SCORE DIGITS, PLACE TEXT MESSAGE
;SLEEP, TURN OFF PRIZE & TEXT, REPLACE FACE & LIVES, KILL COLOR CYCLE
;A10=0,1,2 FOR PRIZE TYPE
;DELETE FLOATING CASH IMAGE
MOVE A8,A0
CALLA DELOBJ
DIE
TPZ1:
;TOUCHED PRIZE 1
CLR A10
INHR
;CHANGE OID, RAISE ZPOS, SEND TOWARD P1/P2 TV MONITOR, SLEEP 2 SEC, KILL, DIE
;RESET PZFLG
MMTM SP,A1,A2,A3,A4,A5,A6,A7,A9
MOVE *A0(OPLINK),A0,L
MOVB *A0(PNUM),A9 ;PLAYER 1 OR 2
MOVK 1,A0
MOVB A0,@PZFLG
MOVE @CIRCUIT,A0
SLL 5,A0
ADDI PZLSND,A0
MOVE *A0,A0,L
MOVE A10,A1
SLL 5,A1
ADD A1,A0
MOVE *A0,A0,L
CALLA ONESND
MOVI CLSNEUT|TYPNEUT,A0
MOVE A0,*A8(OID)
MOVI DMAWNZ|M_NOCOLL,A0
MOVE A0,*A8(OFLAGS)
MOVI 200,A0
MOVE A0,*A8(OZPOS)
;
CLR A5
CLR A6
MOVE @WAVEYX,A0,L ;WAVE TL OFFSET
MOVY A0,A6 ;Y VALUE TO SCROLL TO IN A10
SRL 16,A6
ADDI 40,A6
MOVX A0,A5 ;X VALUE TO SCROLL TO IN A9
ADDI 30,A5
CMPI 1,A9
JREQ UPL
;PLYR 2 TV SEEK
;INC P2PZ CNT
MOVI P2DATA,A2
MOVI PZPT,A1
CALLA SCRADD2
MOVE A10,A0
SLL 3,A0
ADDI P2PZ1,A0
MOVB *A0,A1
ADDK 10,A1
MOVB A1,*A0
ADDI 340,A5
JRUC UPL2
UPL
;INC P1PZ CNT
MOVI P1DATA,A2
MOVI PZPT,A1
CALLA SCRADD2
MOVE A10,A0
SLL 3,A0
ADDI P1PZ1,A0
MOVB *A0,A1
ADDK 10,A1
MOVB A1,*A0
UPL2
CALLA XYSEEK2
MOVE A5,*A8(OXVEL),L
MOVE A6,*A8(OYVEL),L
CREATE FLYPID,KOFF
MMFM SP,A1,A2,A3,A4,A5,A6,A7,A9
RETS
;
KOFF
MOVE @WAVEYX,A0,L ;WAVE TL OFFSET
MOVY A0,A11 ;Y VALUE TO SCROLL TO IN A10
SRL 16,A11
ADDI 35,A11
SLP SLEEP 4
SLP2 MOVE *A8(OYPOS),A0
CMP A0,A11
JRC SLP
MOVE A9,A0
DEC A0
SLL 3,A0
ADDI CNTDIG1,A0
MOVB *A0,A0
JRNZ OUT
MOVB @WNTOUT,A0
JRZ SLP2Z
OUT
;WANTOUT OF ARENA!
CLR A0
MOVB A0,@WNTOUT
MOVE A8,A0
CALLA DELOBJ
DIE
SLP2Z
;HAS REACHED TOP
;KILL PRIZE, REMOVE FACE, REMOVE LIVES, PLACE GIFT PICTURE, START COLOR CYCLE
;REMOVE SCORE DIGITS, PLACE TEXT MESSAGE
;SLEEP, TURN OFF PRIZE & TEXT, REPLACE FACE & LIVES, KILL COLOR CYCLE
;A10=0,1,2 FOR PRIZE TYPE
; MOVE @GAMSTATE,A0,W
; CMPI INAMODE,A0
; JRZ CLEANUP
MOVI GIFT,A0
CALLA ONESND
CMPI 1,A9
JREQ LSD
;RIGHT SIDE
MOVE @RFACEP,A0,L
CALLA OBJOFF
MOVE @P2LVS,A0,L
CALLA OBJOFF
MOVE @METERP2,A0,L
CALLA OBJOFF
MOVE @SCORETYP,A0
ANDI 01,A0
MOVE A0,@SCORETYP
;PLACE CORRECT PRIZE AND TEXT IN PLYR 2 AREA
;CIRCUIT 1
SLL 5,A10
MOVE @CIRCUIT,A6
SLL 5,A6
ADDI PZL,A6
MOVE *A6,A6,L
; MOVI PZPIC,A6
ADD A10,A6
MOVE @RFACEP,A0,L
MOVE *A0(OYPOS),A1
ADDI 6,A1
MOVE A1,*A8(OYPOS)
MOVE *A0(OXPOS),A1
SUBI 10,A1
MOVE A1,*A8(OXPOS)
CLR A0
MOVE A0,*A8(OXVEL),L
MOVE A0,*A8(OYVEL),L
MOVI 300,A0
MOVE A0,*A8(OZPOS)
MOVE *A6,A1,L
MOVE *A8(OFLAGS),A4
;CHANGE TO PRZ PALETTE!
MOVI PRZ,A0
CALLA GETFPAL
MOVE A0,*A8(OPAL),W
CALLA ANI
; NOW PLACE TEXT ON SCORE BOARD
;CIRCUIT 1
MOVI [0112H,0],A0
MOVI [35H,0],A1
MOVE @CIRCUIT,A2
SLL 5,A2
ADDI TLST,A2
MOVE *A2,A2,L
ADD A2,A10
; ADDI TTXT,A10
MOVE *A10,A2,L
MOVI 19,A3 ;259
MOVI DMAWNZ|M_NOCOLL,A4 ;NON-ZERO VALUE
MOVI CLSNEUT|TYPNEUT,A5
CLR A6
CLR A7
PUSH A8
CALLA BEGINOBJ
MOVE A8,A9
PULL A8
MOVB @PZON,A0
JRNE SP2
CREATE 0,PRZ_LIT
SP2
MOVB @PZON,A0
ADDI 250,A0
MOVB A0,@PZON
;NEED TO WAKE UP FROM THIS SLEEP SOONER IF WNTOUT IS SET TO 1!
MOVK 24,A10
R4 SLEEP 5
MOVB @WNTOUT,A0
JRNZ WNT2
DSJS A10,R4
WNT2
CLR A0
MOVB A0,@WNTOUT
MOVK 1,A0
MOVB A0,@PZON ;COLOR CYCLER WILL TURN IT OFF
MOVE @METERP2,A0,L
CALLA OBJON
MOVE @RFACEP,A0,L
CALLA OBJON
MOVE @P2LVS,A0,L
CALLA OBJON
MOVE @SCORETYP,A0
ORI 2,A0
MOVE A0,@SCORETYP
;DELETE FLOATING PRIZE PACKAGE
MOVE A9,A0
CALLA DELOBJ
;CLEANUP
MOVE A8,A0
CALLA DELOBJ
DIE
LSD
;LEFT SIDE
MOVE @LFACEP,A0,L
CALLA OBJOFF
MOVE @P1LVS,A0,L
CALLA OBJOFF
MOVE @METERP1,A0,L
CALLA OBJOFF
MOVE @SCORETYP,A0
ANDI 02,A0
MOVE A0,@SCORETYP
;PLACE CORRECT PRIZE AND TEXT IN PLYR 1 AREA
;CIRCUIT 1
SLL 5,A10
MOVE @CIRCUIT,A6
SLL 5,A6
ADDI PZL,A6
MOVE *A6,A6,L
; MOVI PZPIC,A6
ADD A10,A6
MOVE @LFACEP,A0,L
MOVE *A0(OYPOS),A1
ADDI 6,A1
MOVE A1,*A8(OYPOS)
MOVE *A0(OXPOS),A1
SUBI 10,A1
MOVE A1,*A8(OXPOS)
CLR A0
MOVE A0,*A8(OXVEL),L
MOVE A0,*A8(OYVEL),L
MOVI 300,A0
MOVE A0,*A8(OZPOS)
MOVE *A6,A1,L
MOVE *A8(OFLAGS),A4
;CHANGE TO PRZ PALETTE!
MOVI PRZ,A0
CALLA GETFPAL
MOVE A0,*A8(OPAL),W
CALLA ANI
MOVI [024H,0],A0
MOVI [35H,0],A1
MOVE @CIRCUIT,A2
SLL 5,A2
ADDI TLST,A2
MOVE *A2,A2,L
ADD A2,A10
MOVE *A10,A2,L
MOVI 19,A3 ;259
MOVI DMAWNZ|M_NOCOLL,A4 ;NON-ZERO VALUE
MOVI CLSNEUT|TYPNEUT,A5
CLR A6
CLR A7
PUSH A8
CALLA BEGINOBJ
MOVE A8,A9
PULL A8
MOVB @PZON,A0
JRNE SP1
CREATE 0,PRZ_LIT
SP1
MOVB @PZON,A0
ADDI 150,A0
MOVB A0,@PZON
MOVK 24,A10
R5 SLEEP 5
MOVB @WNTOUT,A0
JRNZ WNT3
DSJS A10,R5
WNT3
CLR A0
MOVB A0,@WNTOUT
MOVK 1,A0
MOVB A0,@PZON
MOVE @METERP1,A0,L
CALLA OBJON
MOVE @LFACEP,A0,L
CALLA OBJON
MOVE @P1LVS,A0,L
CALLA OBJON
MOVE @SCORETYP,A0
ORI 1,A0
MOVE A0,@SCORETYP
;DELETE FLOATING PRIZE PACKAGE
MOVE A8,A0
CALLA DELOBJ
MOVE A9,A0
CALLA DELOBJ
DIE
TPZ2:
MOVK 1,A10
JRUC INHR
TPZ3:
MOVK 2,A10
JRUC INHR
TTXT .LONG TTSTR,TCAR,TVCR
T2TXT .LONG TTV,TLUGG,TTRIP
T3TXT .LONG THGM,TMWR,TMEAT
TLST .LONG TTXT,T2TXT,T3TXT
PZPIC .LONG TSTR,CRPRZ,VCR
PZ2PIC .LONG TVPRZ,LUGG,TRPPRZ
PZ3PIC .LONG HGMPRZ,MWRPRZ,MTPRZ
PZL .LONG PZPIC,PZ2PIC,PZ3PIC
RINGON:
;TURN RING ON AROUND PLAYER ICON PICKUP
;REDUCE MMTM!!!
MMTM SP,A1,A7,A9
MOVE *A0(OPLINK),A0,L
MOVB *A0(PNUM),A9
MOVE @RINGTIME,A10
; MOVI 300,A10 ;TIME RINGS ARE ON
CREATE RNGPID,RINGS ;PLACE RING AROUND PLAYER X
MOVE A8,A0
CALLA DELOBJ
MOVK 1,A0
MOVB A0,@ICNFLG
MOVI ICSND,A0
CALLA ONESND
MMFM SP,A1,A7,A9
RETS
KEYON:
;PLAYER NOW CARRIES KEY
;REDUCE MMTM!!!
MMTM SP,A1,A2,A3,A4,A5,A6,A7
MOVE *A0(OPLINK),A0,L
MOVB *A0(PNUM),A9
MOVI P1DATA,A2
MOVI KEYPT,A1
CMPI 1,A9
JRZ KEY1
MOVI P2DATA,A2
KEY1 CALLA SCRADD2
; MOVE A8,A0
; CALLA DELOBJ
MOVK 1,A0
MOVB A0,@ICNFLG
MOVI FREESND,A0
CALLA ONESND
CALLA SENDCRNR
CREATE FLYPID,KOFFC
MMFM SP,A1,A2,A3,A4,A5,A6,A7
RETS
SHOEON:
;FAST SHOES
;REDUCE MMTM!!!
MMTM SP,A1,A2
MOVE *A0(OPLINK),A0,L ;A0=PLAYER WHO GOT THIS ICON
MOVE *A0(LEG_PRC),A0,L
MOVI 300,A1 ;TIME SHOES ARE ON
MOVE @CIRCUIT,A2
CMPI 2,A2
JRNZ SH1
MOVI 500,A1 ;TIME SHOES ARE ON
SH1
MOVB A1,@ICNFLG
MOVE A1,*A0(SHOECNT),W
MOVE A8,A0
CALLA DELOBJ
MOVI WOO2,A0
CALLA ONESND
MMFM SP,A1,A2
RETS
SMRTON:
;SMART BOMB EVERYTHING ON SCREEN
;REDUCE MMTM!!!
MMTM SP,A1,A7,A9,A11
MOVE A0,A9 ;KEEP PLAYER IMAGE WHO PICKED ME UP
MOVK 1,A1
MOVB A1,@ICNFLG
MOVE A8,A0
CALLA DELOBJ
CREATE 0,SBSND
CREATE 0,SBOMB
MMFM SP,A1,A7,A9,A11
RETS
SBSND
MOVI EXP3HIB,A0
CALLA ONESND
SLEEP 5
MOVI EXP3HIB,A0
CALLA ONESND
SLEEP 5
MOVI EXP3HIB,A0
CALLA ONESND
SLEEP 5
MOVI EXP3HIB,A0
CALLA ONESND
SLEEP 17
MOVI BINGO,A0
CALLA ONESND
DIE
SBOMB
;SMART BOMB
;A9=PLYR IMG PTR WHO GOT ME
MOVE *A9(OID),A0
MOVI P1DATA,A9
CMPI CLSPLYR|TYPPLYR|SUBPL_1,A0
JREQ NC
MOVI P2DATA,A9
;A9=P1 OR P2DATA FOR SCORING SMART BOMB POINTS
NC MOVB @SHK_ON,A0
JRNZ BAD0
MOVI 30,A10
CALLA SHAKER
BAD0 MOVI CLSENMY|TYPHULK,A0
MOVI 0FFFFH,A1
CALLA EXISTOBJ
JRZ BAD1
;FOUND A HULK
MOVE A0,A8
CALLA KILL_H1 ;KILL_HULK
JRUC BAD0
BAD1
MOVI CLSENMY|TYPFAT,A0
MOVI 0FFFFH,A1
CALLA EXISTOBJ
JRZ BAD3
;FOUND A FAT
MOVE A0,A8
;NO SCORE FOR THESE FAT GUYS
CALLA KILL_F2 ;KILL_FAT
JRUC BAD1
BAD3
MOVI CLSNEUT|TYPTANK,A0
MOVI 0FFFFH,A1
CALLA EXISTOBJ
JRZ BAD4A
;FOUND A TANK BOTTOM
MOVE A0,A8
;WHO GETS SCORE HERE?
CALLA KILL_TK
JRUC BAD3
BAD4A
MOVI CLSENMY|TYPTANK,A0
MOVI 0FFFFH,A1
CALLA EXISTOBJ
JRZ BAD4
;FOUND A TANK BOTTOM
MOVE A0,A8
;WHO GETS SCORE HERE?
CALLA KILL_TK
JRUC BAD4A
BAD4
MOVI CLSENMY|TYPTORSO,A0
MOVI 0FFFFH,A1
CALLA EXISTOBJ
JRZ BAD5
;FOUND A TORSO
MOVE A0,A8
CALLA KILL_TS
JRUC BAD4
BAD5
MOVI CLSENMY|TYPORB,A0
MOVI 0FFFFH,A1
CALLA EXISTOBJ
JRZ BAD6
;NO!!
;FOUND AN ORB
MOVE A0,A8
CALLA KILL_OB
JRUC BAD5
BAD6
MOVI CLSENMY|TYPRBTA,A0
MOVI 0FFFFH,A1
CALLA EXISTOBJ
JRZ BAD7
;NO!!
;FOUND AN ORB
MOVE A0,A8
CALLA KILL_R1
JRUC BAD6
BAD7
MOVI CLSENMY|TYPGAL,A0 ;(OID)
MOVI 0FFC0H,A1
CALLA EXISTOBJ
JRZ BAD8
;FOUND GALAGA
MOVE A0,A8
CALLA SMRT_GAL
JRUC BAD7
BAD8
MOVI CLSENMY|TYPSNK,A0
MOVI 0FFFFH,A1
CALLA EXISTOBJ
JRZ BADCLN
;NO!!
;FOUND AN SNAKE
MOVE A0,A8
CALLA KILL_SK1
JRUC BAD8
;INSERT OTHERS HERE
BADCLN
BAD2
SLEEP 1
MOVI CLSENMY|TYPCBALL,A0
MOVI 0FFFFH,A1
CALLA EXISTOBJ
JRZ BAD9
;FOUND A CBALL/SHRAPNEL
;NO SCORE
MOVE A0,A8
CALLA KILL_CBALL
JRUC BAD2
BAD9
;RESET ALL CNTS!
CALLA ZEROCNTS
DIE
NSTPON:
;NON STOPPING BULLET
;REDUCE MMTM!!!
MMTM SP,A1,A2,A3,A4,A5,A6,A7,A10
MOVE *A0(OPLINK),A0,L ;A0=PLAYER WHO GOT THIS ICON
MOVK 4,A1
MOVB A1,@ICNFLG
MOVE A1,*A0(WPN_TYP),W
MOVE A0,A10 ;A10=PLAYER
MOVE A8,A0
CALLA DELOBJ
CREATE 0,FILLUP
MOVI ICON,A0
CALLA ONESND
MOVK 1,A0
MOVB A0,@FFLG ;SOMEONE FILLING UP FLAG
MMFM SP,A1,A2,A3,A4,A5,A6,A7,A10
RETS
GRENON:
;REDUCE MMTM!!!
MMTM SP,A1,A2,A3,A4,A5,A6,A7,A10
MOVE *A0(OPLINK),A0,L
;TURN ON RINGS IF FLATFACE IS OUT!
MOVB @FACEON,A1
JREQ GRENON1
MMTM SP,A0
MOVB *A0(PNUM),A9
MOVI 270,A10 ;TIME RINGS ARE ON ;320
CREATE RNGPID,RINGS ;PLACE RING AROUND PLAYER X
MMFM SP,A0
GRENON1
MOVK 3,A1
MOVB A1,@ICNFLG
MOVE A1,*A0(WPN_TYP),W
MOVE A0,A10
MOVE A8,A0
CALLA DELOBJ
CREATE 0,FILLUP
MOVI ICON,A0
CALLA ONESND
MOVK 1,A0
MOVB A0,@FFLG ;SOMEONE FILLING UP FLAG
MMFM SP,A1,A2,A3,A4,A5,A6,A7,A10
RETS
;
SPRAYON:
MMTM SP,A1,A2,A3,A4,A5,A6,A7,A10
;A8=ICON IMAGE
;A0=PLAYER WHO GOT ME
MOVE *A0(OPLINK),A0,L
MOVK 1,A1
MOVB A1,@ICNFLG
MOVE A1,*A0(WPN_TYP),W
MOVE A0,A10
MOVE A8,A0
CALLA DELOBJ ;KILL ICON IMAGE
CREATE 0,FILLUP ;FILL METER UP
MOVI ICON,A0
CALLA ONESND
MOVK 1,A0
MOVB A0,@FFLG ;SOMEONE FILLING UP FLAG
MMFM SP,A1,A2,A3,A4,A5,A6,A7,A10
RETS
;
PODON:
MMTM SP,A1,A2,A3,A4,A5,A6,A7,A10
MOVE *A0(OPLINK),A0,L
MOVB @FACEON,A1
JREQ PODON1
MMTM SP,A0
MOVB *A0(PNUM),A9
MOVI 260,A10 ;TIME RINGS ARE ON ;300
CREATE RNGPID,RINGS ;PLACE RING AROUND PLAYER X
MMFM SP,A0
PODON1
MOVK 2,A1
MOVB A1,@ICNFLG
MOVE A1,*A0(WPN_TYP),W
MOVE A0,A10
MOVE A8,A0
CALLA DELOBJ
CREATE 0,FILLUP
MOVI ICON,A0
CALLA ONESND
MOVK 1,A0
MOVB A0,@FFLG ;SOMEONE FILLING UP FLAG
MMFM SP,A1,A2,A3,A4,A5,A6,A7,A10
RETS
;
MV_BULL:
;DEFLECT BULLET
MOVE *A8(OID),A0
ANDI F_SUBT,A0
;CAN WE JUST NEGATE ALL BULLET TYPES VELOCITIES?
CMPI SUBLZR,A0
JRNE KILL_BULL
; JRNE RT
MMTM SP,A1,A6,A7,A2,A3,A4,A13
;GET NEW X,Y VELS THEN SET BLTDIR (IN PDATA) ACCORDINGLY
MOVI 1,B0
MOVI 9,B1
CALLA RANGRAND
CMPI 3,A0
JRNE DX
DEC A0
DX
MOVE A0,@B_DIR
MOVE *A8(OPLINK),A13,L
CALLR GET_CNVRT
CALLR STUFIT
MOVE A2,A1
CALLA ANI
;A6=XVEL,A7=YVEL,A4=FLAGS,A2=OIMG OF NEW BULLET
MOVE A6,*A8(OXVEL),L
MOVE A7,*A8(OYVEL),L
MMFM SP,A1,A6,A7,A2,A3,A4,A13
RT RETS
KILL_BULL:
; DELETE OBJ, UPDATE BLT_CNT, KILL BULLETS PROC
MOVE *A8(OID),A0,W
ANDI 0FFFFH,A0
CMPI CLSPLYR|TYPPLBL|SUBGRND,A0
JRNE KB0
;MUST KILL SHADOW OF GRENADE ALSO!
MOVE *A8(OPLINK),A0,L
CALLA GETA9
CALLA KILL ;KILLS PROCESS IN A0
MOVE A9,A0
CALLA DELOBJ
JRUC KB
KB0 MOVE *A8(OPLINK),A0,L
CALLA KILL ;KILLS PROCESS IN A0
KB:
MOVE A8,A0
CALLA DELOBJ
RETS
KILL_BULLT:
; DELETE OBJ, UPDATE BLT_CNT, KILL BULLETS PROC
MOVE *A0(OPLINK),A0,L
MOVB *A0(PDATA),A0 ;ADRIVER IN TANKS FILE! CAREFUL!
JREQ KILL_BULL
RETS
FIRE_DIRECTION:
CLR A6 ;A6 IS A RUNNING CNT WHICH WILL END
;UP BEING A DIRECTION CNT (0-9)
;0 SHOULD NEVER BE RESULT!
MOVE *A13(STICK),A5,L ;JOYSTICK 2 CONTROL READ
MOVE *A5,A5,W ;GET ACTUAL VALUE OF STICK
BTST BMPFUP,A5
JRZ NXT1
ADDI 1,A6
NXT1:
BTST BMPFDOWN,A5
JRZ NXT2
ADDI 2,A6
NXT2:
BTST BMPFLEFT,A5
JRZ NXT3
ADDI 7,A6
NXT3:
BTST BMPFRYTE,A5
JRZ ALL_DIR
ADDI 4,A6
ALL_DIR:
CMPI 9,A6
JRLS RETSOUT
MOVK 9,A6
RETSOUT
MOVE A6,@B_DIR
RETS
BULYV: .LONG -BLTYVEL,-BLTYVEL,0,BLTYVEL,BLTYVEL,BLTYVEL,0,-BLTYVEL
BULXV: .LONG 0,BLTXVEL,BLTXVEL,BLTXVEL,0,-BLTXVEL,-BLTXVEL,-BLTXVEL
BUL5YV: .LONG -BLT5YVEL,-BLT5YVEL,0,BLT5YVEL,BLT5YVEL,BLT5YVEL,0,-BLT5YVEL
BUL5XV: .LONG 0,BLT5XVEL,BLT5XVEL,BLT5XVEL,0,-BLT5XVEL,-BLT5XVEL,-BLT5XVEL
GRNYV: .LONG -GRNYVEL,-GRNYVEL,0,GRNYVEL,GRNYVEL,GRNYVEL,0,-GRNYVEL
GRNXV: .LONG 0,GRNXVEL,GRNXVEL,GRNXVEL,0,-GRNXVEL,-GRNXVEL,-GRNXVEL
GRNYV2: .LONG -GRNYVEL2,-GRNYVEL2,0,GRNYVEL2,GRNYVEL2,GRNYVEL2,0,-GRNYVEL2
GRNXV2: .LONG 0,GRNXVEL2,GRNXVEL2,GRNXVEL2,0,-GRNXVEL2,-GRNXVEL2,-GRNXVEL2
BUL2YV: .LONG -BLTYVEL,-BLTYVEL,-(BLTYVEL/2),BLTYVEL/2,BLTYVEL
.LONG BLTYVEL,BLTYVEL/2,-BLTYVEL
BUL2XV: .LONG -(BLTXVEL/2),BLTXVEL/2,BLTXVEL,BLTXVEL,BLTXVEL/2
.LONG -(BLTXVEL/2),-BLTXVEL,-(BLTXVEL/2)
BUL3YV: .LONG -BLTYVEL,-(BLTYVEL/2),BLTYVEL/2,BLTYVEL,BLTYVEL
.LONG BLTYVEL/2,-(BLTYVEL/2),-(BLTYVEL/2)
BUL3XV: .LONG BLTXVEL/2,BLTXVEL,BLTXVEL,BLTXVEL/2,-(BLTXVEL/2)
.LONG -BLTXVEL,-BLTXVEL,-BLTXVEL
BXL: .LONG -010000H,008000H,0018000H,08000H,-010000H,-28000H,-30000H,-28000H
BXH: .LONG 0010000H,028000H,030000H,28000H,010000H,-08000H,-018000H,-08000H
BYL: .LONG -028000H,-28000H,-010000H,08000H,018000H,008000H,-010000H,-28000H
BYH: .LONG -018000H,-08000H,0010000H,28000H,28000H,028000H,0010000H,-08000H
WHICHYV:
.LONG BULYV,BUL2YV,BUL3YV
WHICHXV:
.LONG BULXV,BUL2XV,BUL3XV
STRT_WPN:
;FROM TORSO PROCESS
MOVB *A13(PNUM),A11 ;PLAYER WHO FIRED ME PASSED IN A11
MOVE *A13(WPN_TYP),A0,W
JRNZ W1
;WEAPON 1 - NORMAL FIRE POWER
CREATE BULPID,WPN1
MOVE *A13(LSRPTR),A0,L ;HELPER ON FLAG 1=YES
JRZ NOLASER
CREATE BULPID,WPN1A
NOLASER:
MOVI SHOT,A0 ;RIFLE SHOT
CALLA ONESND
RETS
W1
CMPI 1,A0
JRNE W2
;SPRAY WEAPON
;WEAPON 2
MOVE *A13(SHOTCNT),A0
DEC A0
MOVE A0,*A13(SHOTCNT)
JRGT S7
;UPDATE METER
MOVE A13,A10
CALLA METERS
S7:
CLR A10
CREATE BULPID,WPN2
MOVK 1,A10
CREATE BULPID,WPN2
MOVK 2,A10
CREATE BULPID,WPN2
MOVE *A13(LSRPTR),A0,L
JRZ NOLASER2
MOVE *A13(SHOTCNT),A0
DEC A0
MOVE A0,*A13(SHOTCNT)
JRGT S7A
;UPDATE METER
MOVE A13,A10
CALLA METERS
S7A:
CLR A10
CREATE BULPID,WPN2A
MOVK 1,A10
CREATE BULPID,WPN2A
MOVK 2,A10