-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinvader_22.bas.lst
5274 lines (4374 loc) · 183 KB
/
invader_22.bas.lst
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 C:\Atari2600Dev\my_projects\Invader_Atari_2600_Basic\invader_22.bas.asm LEVEL 1 PASS 2
1 3000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details.
2 3000 ????
3 3000 ???? processor 6502
------- FILE vcs.h LEVEL 2 PASS 2
0 3000 ???? include "vcs.h"
1 3000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details.
2 3000 ????
3 3000 ???? ; VCS.H
4 3000 ???? ; Version 1.05, 13/November/2003
5 3000 ????
6 3000 ???? 00 69 VERSION_VCS = 105
7 3000 ????
8 3000 ???? ; THIS IS A PRELIMINARY RELEASE OF *THE* "STANDARD" VCS.H
9 3000 ???? ; THIS FILE IS EXPLICITLY SUPPORTED AS A DASM-PREFERRED COMPANION FILE
10 3000 ???? ; PLEASE DO *NOT* REDISTRIBUTE THIS FILE!
11 3000 ???? ;
12 3000 ???? ; This file defines hardware registers and memory mapping for the
13 3000 ???? ; Atari 2600. It is distributed as a companion machine-specific support package
14 3000 ???? ; for the DASM compiler. Updates to this file, DASM, and associated tools are
15 3000 ???? ; available at at http://www.atari2600.org/dasm
16 3000 ???? ;
17 3000 ???? ; Many thanks to the original author(s) of this file, and to everyone who has
18 3000 ???? ; contributed to understanding the Atari 2600. If you take issue with the
19 3000 ???? ; contents, or naming of registers, please write to me ([email protected])
20 3000 ???? ; with your views. Please contribute, if you think you can improve this
21 3000 ???? ; file!
22 3000 ???? ;
23 3000 ???? ; Latest Revisions...
24 3000 ???? ; 1.05 13/NOV/2003 - Correction to 1.04 - now functions as requested by MR.
25 3000 ???? ; - Added VERSION_VCS equate (which will reflect 100x version #)
26 3000 ???? ; This will allow conditional code to verify VCS.H being
27 3000 ???? ; used for code assembly.
28 3000 ???? ; 1.04 12/NOV/2003 Added TIA_BASE_WRITE_ADDRESS and TIA_BASE_READ_ADDRESS for
29 3000 ???? ; convenient disassembly/reassembly compatibility for hardware
30 3000 ???? ; mirrored reading/writing differences. This is more a
31 3000 ???? ; readability issue, and binary compatibility with disassembled
32 3000 ???? ; and reassembled sources. Per Manuel Rotschkar's suggestion.
33 3000 ???? ; 1.03 12/MAY/2003 Added SEG segment at end of file to fix old-code compatibility
34 3000 ???? ; which was broken by the use of segments in this file, as
35 3000 ???? ; reported by Manuel Polik on [stella] 11/MAY/2003
36 3000 ???? ; 1.02 22/MAR/2003 Added TIMINT($285)
37 3000 ???? ; 1.01 Constant offset added to allow use for 3F-style bankswitching
38 3000 ???? ; - define TIA_BASE_ADDRESS as $40 for Tigervision carts, otherwise
39 3000 ???? ; it is safe to leave it undefined, and the base address will
40 3000 ???? ; be set to 0. Thanks to Eckhard Stolberg for the suggestion.
41 3000 ???? ; Note, may use -DLABEL=EXPRESSION to define TIA_BASE_ADDRESS
42 3000 ???? ; - register definitions are now generated through assignment
43 3000 ???? ; in uninitialised segments. This allows a changeable base
44 3000 ???? ; address architecture.
45 3000 ???? ; 1.0 22/MAR/2003 Initial release
46 3000 ????
47 3000 ????
48 3000 ???? ;-------------------------------------------------------------------------------
49 3000 ????
50 3000 ???? ; TIA_BASE_ADDRESS
51 3000 ???? ; The TIA_BASE_ADDRESS defines the base address of access to TIA registers.
52 3000 ???? ; Normally 0, the base address should (externally, before including this file)
53 3000 ???? ; be set to $40 when creating 3F-bankswitched (and other?) cartridges.
54 3000 ???? ; The reason is that this bankswitching scheme treats any access to locations
55 3000 ???? ; < $40 as a bankswitch.
56 3000 ????
57 3000 ???? - IFNCONST TIA_BASE_ADDRESS
58 3000 ???? -TIA_BASE_ADDRESS = 0
59 3000 ???? ENDIF
60 3000 ????
61 3000 ???? ; Note: The address may be defined on the command-line using the -D switch, eg:
62 3000 ???? ; dasm.exe code.asm -DTIA_BASE_ADDRESS=$40 -f3 -v5 -ocode.bin
63 3000 ???? ; *OR* by declaring the label before including this file, eg:
64 3000 ???? ; TIA_BASE_ADDRESS = $40
65 3000 ???? ; include "vcs.h"
66 3000 ????
67 3000 ???? ; Alternate read/write address capability - allows for some disassembly compatibility
68 3000 ???? ; usage ; to allow reassembly to binary perfect copies). This is essentially catering
69 3000 ???? ; for the mirrored ROM hardware registers.
70 3000 ????
71 3000 ???? ; Usage: As per above, define the TIA_BASE_READ_ADDRESS and/or TIA_BASE_WRITE_ADDRESS
72 3000 ???? ; using the -D command-line switch, as required. If the addresses are not defined,
73 3000 ???? ; they defaut to the TIA_BASE_ADDRESS.
74 3000 ????
75 3000 ???? - IFNCONST TIA_BASE_READ_ADDRESS
76 3000 ???? -TIA_BASE_READ_ADDRESS = TIA_BASE_ADDRESS
77 3000 ???? ENDIF
78 3000 ????
79 3000 ???? - IFNCONST TIA_BASE_WRITE_ADDRESS
80 3000 ???? -TIA_BASE_WRITE_ADDRESS = TIA_BASE_ADDRESS
81 3000 ???? ENDIF
82 3000 ????
83 3000 ???? ;-------------------------------------------------------------------------------
84 3000 ????
85 U002d ???? SEG.U TIA_REGISTERS_WRITE
86 U0000 ORG TIA_BASE_WRITE_ADDRESS
87 U0000
88 U0000 ; DO NOT CHANGE THE RELATIVE ORDERING OF REGISTERS!
89 U0000
90 U0000 00 VSYNC ds 1 ; $00 0000 00x0 Vertical Sync Set-Clear
91 U0001 00 VBLANK ds 1 ; $01 xx00 00x0 Vertical Blank Set-Clear
92 U0002 00 WSYNC ds 1 ; $02 ---- ---- Wait for Horizontal Blank
93 U0003 00 RSYNC ds 1 ; $03 ---- ---- Reset Horizontal Sync Counter
94 U0004 00 NUSIZ0 ds 1 ; $04 00xx 0xxx Number-Size player/missle 0
95 U0005 00 NUSIZ1 ds 1 ; $05 00xx 0xxx Number-Size player/missle 1
96 U0006 00 COLUP0 ds 1 ; $06 xxxx xxx0 Color-Luminance Player 0
97 U0007 00 COLUP1 ds 1 ; $07 xxxx xxx0 Color-Luminance Player 1
98 U0008 00 COLUPF ds 1 ; $08 xxxx xxx0 Color-Luminance Playfield
99 U0009 00 COLUBK ds 1 ; $09 xxxx xxx0 Color-Luminance Background
100 U000a 00 CTRLPF ds 1 ; $0A 00xx 0xxx Control Playfield, Ball, Collisions
101 U000b 00 REFP0 ds 1 ; $0B 0000 x000 Reflection Player 0
102 U000c 00 REFP1 ds 1 ; $0C 0000 x000 Reflection Player 1
103 U000d 00 PF0 ds 1 ; $0D xxxx 0000 Playfield Register Byte 0
104 U000e 00 PF1 ds 1 ; $0E xxxx xxxx Playfield Register Byte 1
105 U000f 00 PF2 ds 1 ; $0F xxxx xxxx Playfield Register Byte 2
106 U0010 00 RESP0 ds 1 ; $10 ---- ---- Reset Player 0
107 U0011 00 RESP1 ds 1 ; $11 ---- ---- Reset Player 1
108 U0012 00 RESM0 ds 1 ; $12 ---- ---- Reset Missle 0
109 U0013 00 RESM1 ds 1 ; $13 ---- ---- Reset Missle 1
110 U0014 00 RESBL ds 1 ; $14 ---- ---- Reset Ball
111 U0015 00 AUDC0 ds 1 ; $15 0000 xxxx Audio Control 0
112 U0016 00 AUDC1 ds 1 ; $16 0000 xxxx Audio Control 1
113 U0017 00 AUDF0 ds 1 ; $17 000x xxxx Audio Frequency 0
114 U0018 00 AUDF1 ds 1 ; $18 000x xxxx Audio Frequency 1
115 U0019 00 AUDV0 ds 1 ; $19 0000 xxxx Audio Volume 0
116 U001a 00 AUDV1 ds 1 ; $1A 0000 xxxx Audio Volume 1
117 U001b 00 GRP0 ds 1 ; $1B xxxx xxxx Graphics Register Player 0
118 U001c 00 GRP1 ds 1 ; $1C xxxx xxxx Graphics Register Player 1
119 U001d 00 ENAM0 ds 1 ; $1D 0000 00x0 Graphics Enable Missle 0
120 U001e 00 ENAM1 ds 1 ; $1E 0000 00x0 Graphics Enable Missle 1
121 U001f 00 ENABL ds 1 ; $1F 0000 00x0 Graphics Enable Ball
122 U0020 00 HMP0 ds 1 ; $20 xxxx 0000 Horizontal Motion Player 0
123 U0021 00 HMP1 ds 1 ; $21 xxxx 0000 Horizontal Motion Player 1
124 U0022 00 HMM0 ds 1 ; $22 xxxx 0000 Horizontal Motion Missle 0
125 U0023 00 HMM1 ds 1 ; $23 xxxx 0000 Horizontal Motion Missle 1
126 U0024 00 HMBL ds 1 ; $24 xxxx 0000 Horizontal Motion Ball
127 U0025 00 VDELP0 ds 1 ; $25 0000 000x Vertical Delay Player 0
128 U0026 00 VDELP1 ds 1 ; $26 0000 000x Vertical Delay Player 1
129 U0027 00 VDELBL ds 1 ; $27 0000 000x Vertical Delay Ball
130 U0028 00 RESMP0 ds 1 ; $28 0000 00x0 Reset Missle 0 to Player 0
131 U0029 00 RESMP1 ds 1 ; $29 0000 00x0 Reset Missle 1 to Player 1
132 U002a 00 HMOVE ds 1 ; $2A ---- ---- Apply Horizontal Motion
133 U002b 00 HMCLR ds 1 ; $2B ---- ---- Clear Horizontal Move Registers
134 U002c 00 CXCLR ds 1 ; $2C ---- ---- Clear Collision Latches
135 U002d
136 U002d ;-------------------------------------------------------------------------------
137 U002d
138 U000e ???? SEG.U TIA_REGISTERS_READ
139 U0000 ORG TIA_BASE_READ_ADDRESS
140 U0000
141 U0000 ; bit 7 bit 6
142 U0000 00 CXM0P ds 1 ; $00 xx00 0000 Read Collision M0-P1 M0-P0
143 U0001 00 CXM1P ds 1 ; $01 xx00 0000 M1-P0 M1-P1
144 U0002 00 CXP0FB ds 1 ; $02 xx00 0000 P0-PF P0-BL
145 U0003 00 CXP1FB ds 1 ; $03 xx00 0000 P1-PF P1-BL
146 U0004 00 CXM0FB ds 1 ; $04 xx00 0000 M0-PF M0-BL
147 U0005 00 CXM1FB ds 1 ; $05 xx00 0000 M1-PF M1-BL
148 U0006 00 CXBLPF ds 1 ; $06 x000 0000 BL-PF -----
149 U0007 00 CXPPMM ds 1 ; $07 xx00 0000 P0-P1 M0-M1
150 U0008 00 INPT0 ds 1 ; $08 x000 0000 Read Pot Port 0
151 U0009 00 INPT1 ds 1 ; $09 x000 0000 Read Pot Port 1
152 U000a 00 INPT2 ds 1 ; $0A x000 0000 Read Pot Port 2
153 U000b 00 INPT3 ds 1 ; $0B x000 0000 Read Pot Port 3
154 U000c 00 INPT4 ds 1 ; $0C x000 0000 Read Input (Trigger) 0
155 U000d 00 INPT5 ds 1 ; $0D x000 0000 Read Input (Trigger) 1
156 U000e
157 U000e ;-------------------------------------------------------------------------------
158 U000e
159 U0298 ???? SEG.U RIOT
160 U0280 ORG $280
161 U0280
162 U0280 ; RIOT MEMORY MAP
163 U0280
164 U0280 00 SWCHA ds 1 ; $280 Port A data register for joysticks:
165 U0281 ; Bits 4-7 for player 1. Bits 0-3 for player 2.
166 U0281
167 U0281 00 SWACNT ds 1 ; $281 Port A data direction register (DDR)
168 U0282 00 SWCHB ds 1 ; $282 Port B data (console switches)
169 U0283 00 SWBCNT ds 1 ; $283 Port B DDR
170 U0284 00 INTIM ds 1 ; $284 Timer output
171 U0285
172 U0285 00 TIMINT ds 1 ; $285
173 U0286
174 U0286 ; Unused/undefined registers ($285-$294)
175 U0286
176 U0286 00 ds 1 ; $286
177 U0287 00 ds 1 ; $287
178 U0288 00 ds 1 ; $288
179 U0289 00 ds 1 ; $289
180 U028a 00 ds 1 ; $28A
181 U028b 00 ds 1 ; $28B
182 U028c 00 ds 1 ; $28C
183 U028d 00 ds 1 ; $28D
184 U028e 00 ds 1 ; $28E
185 U028f 00 ds 1 ; $28F
186 U0290 00 ds 1 ; $290
187 U0291 00 ds 1 ; $291
188 U0292 00 ds 1 ; $292
189 U0293 00 ds 1 ; $293
190 U0294
191 U0294 00 TIM1T ds 1 ; $294 set 1 clock interval
192 U0295 00 TIM8T ds 1 ; $295 set 8 clock interval
193 U0296 00 TIM64T ds 1 ; $296 set 64 clock interval
194 U0297 00 T1024T ds 1 ; $297 set 1024 clock interval
195 U0298
196 U0298 ;-------------------------------------------------------------------------------
197 U0298 ; The following required for back-compatibility with code which does not use
198 U0298 ; segments.
199 U0298
200 3000 ???? SEG
201 3000 ????
202 3000 ???? ; EOF
------- FILE C:\Atari2600Dev\my_projects\Invader_Atari_2600_Basic\invader_22.bas.asm
------- FILE macro.h LEVEL 2 PASS 2
0 3000 ???? include "macro.h"
1 3000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details.
2 3000 ????
3 3000 ???? ; MACRO.H
4 3000 ???? ; Version 1.05, 13/NOVEMBER/2003
5 3000 ????
6 3000 ???? 00 69 VERSION_MACRO = 105
7 3000 ????
8 3000 ???? ;
9 3000 ???? ; THIS FILE IS EXPLICITLY SUPPORTED AS A DASM-PREFERRED COMPANION FILE
10 3000 ???? ; PLEASE DO *NOT* REDISTRIBUTE MODIFIED VERSIONS OF THIS FILE!
11 3000 ???? ;
12 3000 ???? ; This file defines DASM macros useful for development for the Atari 2600.
13 3000 ???? ; It is distributed as a companion machine-specific support package
14 3000 ???? ; for the DASM compiler. Updates to this file, DASM, and associated tools are
15 3000 ???? ; available at at http://www.atari2600.org/dasm
16 3000 ???? ;
17 3000 ???? ; Many thanks to the people who have contributed. If you take issue with the
18 3000 ???? ; contents, or would like to add something, please write to me
19 3000 ???? ; ([email protected]) with your contribution.
20 3000 ???? ;
21 3000 ???? ; Latest Revisions...
22 3000 ???? ;
23 3000 ???? ; 1.05 14/NOV/2003 - Added VERSION_MACRO equate (which will reflect 100x version #)
24 3000 ???? ; This will allow conditional code to verify MACRO.H being
25 3000 ???? ; used for code assembly.
26 3000 ???? ; 1.04 13/NOV/2003 - SET_POINTER macro added (16-bit address load)
27 3000 ???? ;
28 3000 ???? ; 1.03 23/JUN/2003 - CLEAN_START macro added - clears TIA, RAM, registers
29 3000 ???? ;
30 3000 ???? ; 1.02 14/JUN/2003 - VERTICAL_SYNC macro added
31 3000 ???? ; (standardised macro for vertical synch code)
32 3000 ???? ; 1.01 22/MAR/2003 - SLEEP macro added.
33 3000 ???? ; - NO_ILLEGAL_OPCODES switch implemented
34 3000 ???? ; 1.0 22/MAR/2003 Initial release
35 3000 ????
36 3000 ???? ; Note: These macros use illegal opcodes. To disable illegal opcode usage,
37 3000 ???? ; define the symbol NO_ILLEGAL_OPCODES (-DNO_ILLEGAL_OPCODES=1 on command-line).
38 3000 ???? ; If you do not allow illegal opcode usage, you must include this file
39 3000 ???? ; *after* including VCS.H (as the non-illegal opcodes access hardware
40 3000 ???? ; registers and require them to be defined first).
41 3000 ????
42 3000 ???? ; Available macros...
43 3000 ???? ; SLEEP n - sleep for n cycles
44 3000 ???? ; VERTICAL_SYNC - correct 3 scanline vertical synch code
45 3000 ???? ; CLEAN_START - set machine to known state on startup
46 3000 ???? ; SET_POINTER - load a 16-bit absolute to a 16-bit variable
47 3000 ????
48 3000 ???? ;-------------------------------------------------------------------------------
49 3000 ???? ; SLEEP duration
50 3000 ???? ; Original author: Thomas Jentzsch
51 3000 ???? ; Inserts code which takes the specified number of cycles to execute. This is
52 3000 ???? ; useful for code where precise timing is required.
53 3000 ???? ; ILLEGAL-OPCODE VERSION DOES NOT AFFECT FLAGS OR REGISTERS.
54 3000 ???? ; LEGAL OPCODE VERSION MAY AFFECT FLAGS
55 3000 ???? ; Uses illegal opcode (DASM 2.20.01 onwards).
56 3000 ????
57 3000 ???? MAC sleep
58 3000 ???? .CYCLES SET {1}
59 3000 ????
60 3000 ???? IF .CYCLES < 2
61 3000 ???? ECHO "MACRO ERROR: 'SLEEP': Duration must be > 1"
62 3000 ???? ERR
63 3000 ???? ENDIF
64 3000 ????
65 3000 ???? IF .CYCLES & 1
66 3000 ???? IFNCONST NO_ILLEGAL_OPCODES
67 3000 ???? nop 0
68 3000 ???? ELSE
69 3000 ???? bit VSYNC
70 3000 ???? ENDIF
71 3000 ???? .CYCLES SET .CYCLES - 3
72 3000 ???? ENDIF
73 3000 ????
74 3000 ???? REPEAT .CYCLES / 2
75 3000 ???? nop
76 3000 ???? REPEND
77 3000 ???? ENDM ;usage: SLEEP n (n>1)
78 3000 ????
79 3000 ???? ;-------------------------------------------------------------------------------
80 3000 ???? ; VERTICAL_SYNC
81 3000 ???? ; Original author: Manuel Polik
82 3000 ???? ; Inserts the code required for a proper 3 scannline
83 3000 ???? ; vertical sync sequence
84 3000 ???? ;
85 3000 ???? ; Note: Alters the accumulator
86 3000 ???? ;
87 3000 ???? ; IN:
88 3000 ???? ; OUT: A = 1
89 3000 ????
90 3000 ???? MAC vertical_sync
91 3000 ???? LDA #$02 ; A = VSYNC enable
92 3000 ???? STA WSYNC ; Finish current line
93 3000 ???? STA VSYNC ; Start vertical sync
94 3000 ???? STA WSYNC ; 1st line vertical sync
95 3000 ???? STA WSYNC ; 2nd line vertical sync
96 3000 ???? LSR ; A = VSYNC disable
97 3000 ???? STA WSYNC ; 3rd line vertical sync
98 3000 ???? STA VSYNC ; Stop vertical sync
99 3000 ???? ENDM
100 3000 ????
101 3000 ???? ;-------------------------------------------------------------------------------
102 3000 ???? ; CLEAN_START
103 3000 ???? ; Original author: Andrew Davie
104 3000 ???? ; Standardised start-up code, clears stack, all TIA registers and RAM to 0
105 3000 ???? ; Sets stack pointer to $FF, and all registers to 0
106 3000 ???? ; Sets decimal mode off, sets interrupt flag (kind of un-necessary)
107 3000 ???? ; Use as very first section of code on boot (ie: at reset)
108 3000 ???? ; Code written to minimise total ROM usage - uses weird 6502 knowledge :)
109 3000 ????
110 3000 ???? MAC clean_start
111 3000 ???? sei
112 3000 ???? cld
113 3000 ????
114 3000 ???? ldx #0
115 3000 ???? txa
116 3000 ???? tay
117 3000 ???? .CLEAR_STACK dex
118 3000 ???? txs
119 3000 ???? pha
120 3000 ???? bne .CLEAR_STACK ; SP=$FF, X = A = Y = 0
121 3000 ????
122 3000 ???? ENDM
123 3000 ????
124 3000 ???? ;-------------------------------------------------------
125 3000 ???? ; SET_POINTER
126 3000 ???? ; Original author: Manuel Rotschkar
127 3000 ???? ;
128 3000 ???? ; Sets a 2 byte RAM pointer to an absolute address.
129 3000 ???? ;
130 3000 ???? ; Usage: SET_POINTER pointer, address
131 3000 ???? ; Example: SET_POINTER SpritePTR, SpriteData
132 3000 ???? ;
133 3000 ???? ; Note: Alters the accumulator, NZ flags
134 3000 ???? ; IN 1: 2 byte RAM location reserved for pointer
135 3000 ???? ; IN 2: absolute address
136 3000 ????
137 3000 ???? MAC set_pointer
138 3000 ???? .POINTER SET {1}
139 3000 ???? .ADDRESS SET {2}
140 3000 ????
141 3000 ???? LDA #<.ADDRESS ; Get Lowbyte of Address
142 3000 ???? STA .POINTER ; Store in pointer
143 3000 ???? LDA #>.ADDRESS ; Get Hibyte of Address
144 3000 ???? STA .POINTER+1 ; Store in pointer+1
145 3000 ????
146 3000 ???? ENDM
147 3000 ????
148 3000 ???? ; EOF
------- FILE C:\Atari2600Dev\my_projects\Invader_Atari_2600_Basic\invader_22.bas.asm
------- FILE multisprite.h LEVEL 2 PASS 2
0 3000 ???? include "multisprite.h"
1 3000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details.
2 3000 ????
3 3000 ???? 00 80 missile0x = $80
4 3000 ???? 00 81 missile1x = $81
5 3000 ???? 00 82 ballx = $82
6 3000 ????
7 3000 ???? ; multisprite stuff below - 5 bytes each starting with spritex
8 3000 ????
9 3000 ???? 00 83 SpriteIndex = $83
10 3000 ????
11 3000 ???? 00 84 player0x = $84
12 3000 ???? 00 85 NewSpriteX = $85 ; X position
13 3000 ???? 00 85 player1x = $85
14 3000 ???? 00 86 player2x = $86
15 3000 ???? 00 87 player3x = $87
16 3000 ???? 00 88 player4x = $88
17 3000 ???? 00 89 player5x = $89
18 3000 ????
19 3000 ???? 00 8a objecty = $8A
20 3000 ???? 00 8a missile0y = $8A
21 3000 ???? 00 8b missile1y = $8B
22 3000 ???? 00 8c bally = $8C
23 3000 ????
24 3000 ???? 00 8d player0y = $8D
25 3000 ???? 00 8e NewSpriteY = $8E ; Y position
26 3000 ???? 00 8e player1y = $8E
27 3000 ???? 00 8f player2y = $8F
28 3000 ???? 00 90 player3y = $90
29 3000 ???? 00 91 player4y = $91
30 3000 ???? 00 92 player5y = $92
31 3000 ????
32 3000 ???? 00 93 NewNUSIZ = $93
33 3000 ???? 00 93 _NUSIZ1 = $93
34 3000 ???? 00 94 NUSIZ2 = $94
35 3000 ???? 00 95 NUSIZ3 = $95
36 3000 ???? 00 96 NUSIZ4 = $96
37 3000 ???? 00 97 NUSIZ5 = $97
38 3000 ????
39 3000 ???? 00 98 NewCOLUP1 = $98
40 3000 ???? 00 98 _COLUP1 = $98
41 3000 ???? 00 99 COLUP2 = $99
42 3000 ???? 00 9a COLUP3 = $9A
43 3000 ???? 00 9b COLUP4 = $9B
44 3000 ???? 00 9c COLUP5 = $9C
45 3000 ????
46 3000 ???? 00 9d SpriteGfxIndex = $9D
47 3000 ????
48 3000 ???? 00 a2 player0pointer = $A2
49 3000 ???? 00 a2 player0pointerlo = $A2
50 3000 ???? 00 a3 player0pointerhi = $A3
51 3000 ????
52 3000 ???? ;P0Top = temp5
53 3000 ???? 00 cf P0Top = $CF ; changed to hard value to avoid dasm issues
54 3000 ???? 00 a4 P0Bottom = $A4
55 3000 ???? 00 a5 P1Bottom = $A5
56 3000 ????
57 3000 ???? 00 a6 player1pointerlo = $A6
58 3000 ???? 00 a7 player2pointerlo = $A7
59 3000 ???? 00 a8 player3pointerlo = $A8
60 3000 ???? 00 a9 player4pointerlo = $A9
61 3000 ???? 00 aa player5pointerlo = $AA
62 3000 ????
63 3000 ???? 00 ab player1pointerhi = $AB
64 3000 ???? 00 ac player2pointerhi = $AC
65 3000 ???? 00 ad player3pointerhi = $AD
66 3000 ???? 00 ae player4pointerhi = $AE
67 3000 ???? 00 af player5pointerhi = $AF
68 3000 ????
69 3000 ???? 00 b0 player0height = $B0
70 3000 ???? 00 b1 spriteheight = $B1 ; heights of multiplexed player sprite
71 3000 ???? 00 b1 player1height = $B1
72 3000 ???? 00 b2 player2height = $B2
73 3000 ???? 00 b3 player3height = $B3
74 3000 ???? 00 b4 player4height = $B4
75 3000 ???? 00 b5 player5height = $B5
76 3000 ????
77 3000 ???? 00 b6 PF1temp1 = $B6
78 3000 ???? 00 b7 PF1temp2 = $B7
79 3000 ???? 00 b8 PF2temp1 = $B8
80 3000 ???? 00 b9 PF2temp2 = $B9
81 3000 ????
82 3000 ???? 00 ba pfpixelheight = $BA
83 3000 ????
84 3000 ???? ; playfield is now a pointer to graphics
85 3000 ???? 00 bb playfield = $BB
86 3000 ???? 00 bb PF1pointer = $BB
87 3000 ????
88 3000 ???? 00 bd PF2pointer = $BD
89 3000 ????
90 3000 ???? 00 bf statusbarlength = $BF
91 3000 ???? 00 bf aux3 = $BF
92 3000 ????
93 3000 ???? 00 c0 lifecolor = $C0
94 3000 ???? 00 c0 pfscorecolor = $C0
95 3000 ???? 00 c0 aux4 = $C0
96 3000 ????
97 3000 ???? ;P1display = temp2 ; temp2 and temp3
98 3000 ???? 00 cc P1display = $cc ; changed to hard value to avoid dasm issues
99 3000 ???? 00 c1 lifepointer = $c1
100 3000 ???? 00 c2 lives = $c2
101 3000 ???? 00 c1 pfscore1 = $c1
102 3000 ???? 00 c2 pfscore2 = $c2
103 3000 ???? 00 c1 aux5 = $c1
104 3000 ???? 00 c2 aux6 = $c2
105 3000 ????
106 3000 ???? 00 c3 playfieldpos = $C3
107 3000 ????
108 3000 ???? ;RepoLine = temp4
109 3000 ???? 00 ce RepoLine = $ce ; changed to hard value to avoid dasm issues
110 3000 ????
111 3000 ???? 00 c4 pfheight = $C4
112 3000 ???? 00 c5 scorepointers = $C5
113 3000 ????
114 3000 ???? 00 cb temp1 = $CB ;used by kernel. can be used in program too, but
115 3000 ???? 00 cc temp2 = $CC ;are obliterated when drawscreen is called.
116 3000 ???? 00 cd temp3 = $CD
117 3000 ???? 00 ce temp4 = $CE
118 3000 ???? 00 cf temp5 = $CF
119 3000 ???? 00 d0 temp6 = $D0
120 3000 ???? 00 d1 temp7 = $D1 ; This is used to aid in bankswitching
121 3000 ????
122 3000 ???? 00 d2 score = $D2
123 3000 ???? 00 d5 scorecolor = $D5 ;need to find other places for these, possibly...
124 3000 ???? 00 d6 rand = $D6
125 3000 ????
126 3000 ????
127 3000 ????
128 3000 ???? 00 d7 A = $d7
129 3000 ???? 00 d7 a = $d7
130 3000 ???? 00 d8 B = $d8
131 3000 ???? 00 d8 b = $d8
132 3000 ???? 00 d9 C = $d9
133 3000 ???? 00 d9 c = $d9
134 3000 ???? 00 da D = $da
135 3000 ???? 00 da d = $da
136 3000 ???? 00 db E = $db
137 3000 ???? 00 db e = $db
138 3000 ???? 00 dc F = $dc
139 3000 ???? 00 dc f = $dc
140 3000 ???? 00 dd G = $dd
141 3000 ???? 00 dd g = $dd
142 3000 ???? 00 de H = $de
143 3000 ???? 00 de h = $de
144 3000 ???? 00 df I = $df
145 3000 ???? 00 df i = $df
146 3000 ???? 00 e0 J = $e0
147 3000 ???? 00 e0 j = $e0
148 3000 ???? 00 e1 K = $e1
149 3000 ???? 00 e1 k = $e1
150 3000 ???? 00 e2 L = $e2
151 3000 ???? 00 e2 l = $e2
152 3000 ???? 00 e3 M = $e3
153 3000 ???? 00 e3 m = $e3
154 3000 ???? 00 e4 N = $e4
155 3000 ???? 00 e4 n = $e4
156 3000 ???? 00 e5 O = $e5
157 3000 ???? 00 e5 o = $e5
158 3000 ???? 00 e6 P = $e6
159 3000 ???? 00 e6 p = $e6
160 3000 ???? 00 e7 Q = $e7
161 3000 ???? 00 e7 q = $e7
162 3000 ???? 00 e8 R = $e8
163 3000 ???? 00 e8 r = $e8
164 3000 ???? 00 e9 S = $e9
165 3000 ???? 00 e9 s = $e9
166 3000 ???? 00 ea T = $ea
167 3000 ???? 00 ea t = $ea
168 3000 ???? 00 eb U = $eb
169 3000 ???? 00 eb u = $eb
170 3000 ???? 00 ec V = $ec
171 3000 ???? 00 ec v = $ec
172 3000 ???? 00 ed W = $ed
173 3000 ???? 00 ed w = $ed
174 3000 ???? 00 ee X = $ee
175 3000 ???? 00 ee x = $ee
176 3000 ???? 00 ef Y = $ef
177 3000 ???? 00 ef y = $ef
178 3000 ???? 00 f0 Z = $f0
179 3000 ???? 00 f0 z = $f0
180 3000 ????
181 3000 ???? 00 f1 spritesort = $f1 ; helps with flickersort
182 3000 ???? 00 f2 spritesort2 = $f2 ; helps with flickersort
183 3000 ???? 00 f3 spritesort3 = $f3
184 3000 ???? 00 f4 spritesort4 = $f4
185 3000 ???? 00 f5 spritesort5 = $f5
186 3000 ????
187 3000 ???? 00 f6 stack1 = $f6
188 3000 ???? 00 f7 stack2 = $f7
189 3000 ???? 00 f8 stack3 = $f8
190 3000 ???? 00 f9 stack4 = $f9
191 3000 ???? ; the stack bytes above may be used in the kernel
192 3000 ???? ; stack = F6-F7, F8-F9, FA-FB, FC-FD, FE-FF
193 3000 ????
194 3000 ???? MAC return
195 3000 ???? ifnconst bankswitch
196 3000 ???? rts
197 3000 ???? else
198 3000 ???? jmp BS_return
199 3000 ???? endif
200 3000 ???? ENDM ; auto-return from either a regular or bankswitched module
------- FILE C:\Atari2600Dev\my_projects\Invader_Atari_2600_Basic\invader_22.bas.asm
------- FILE 2600basic_variable_redefs.h LEVEL 2 PASS 2
0 3000 ???? include "2600basic_variable_redefs.h"
1 3000 ???? ; This file contains variable mapping and other information for the current project.
2 3000 ????
3 3000 ???? 00 20 bscode_length = 32
4 3000 ???? 00 e9 tur_anim_frame = s
5 3000 ???? 00 e8 tur_anim_playing = r
6 3000 ???? 00 e7 tur_hit = q
7 3000 ???? 00 e3 tur_fired = m
8 3000 ???? 00 e0 shot_y = j
9 3000 ???? 00 df shot_x = i
10 3000 ???? 00 db tur_y = e
11 3000 ???? 00 da tur_x = d
12 3000 ???? 00 e5 inv_blast_delay = o
13 3000 ???? 00 e4 inv_hit = n
14 3000 ???? 00 e2 inv_fired = l
15 3000 ???? 00 e1 inv_fire_delay = k
16 3000 ???? 00 de inv_shot_y = h
17 3000 ???? 00 dd inv_shot_x = g
18 3000 ???? 00 dc inv_dir = f
19 3000 ???? 00 d9 inv_delay = c
20 3000 ???? 00 d8 inv_y = b
21 3000 ???? 00 d7 inv_x = a
22 3000 ???? 00 e6 reducing_lives = p
23 3000 ???? 00 ea sound = t
24 3000 ???? 00 00 pfscore = 0
25 3000 ????
26 3000 ???? 00 01 bs_mask = 1
27 3000 ???? 00 08 bankswitch = 8
28 3000 ???? 1f f8 bankswitch_hotspot = $1FF8
29 3000 ???? 00 01 multisprite = 1
30 3000 ???? 00 01 no_blank_lines = 1
------- FILE C:\Atari2600Dev\my_projects\Invader_Atari_2600_Basic\invader_22.bas.asm
8 3000 ???? ifconst bankswitch
9 3000 ???? if bankswitch == 8
10 1000 ORG $1000
11 1000 RORG $D000
12 1000 endif
13 1000 - if bankswitch == 16
14 1000 - ORG $1000
15 1000 - RORG $9000
16 1000 endif
17 1000 - if bankswitch == 32
18 1000 - ORG $1000
19 1000 - RORG $1000
20 1000 endif
21 1000 - if bankswitch == 64
22 1000 - ORG $1000
23 1000 - RORG $1000
24 1000 endif
25 1000 - else
26 1000 - ORG $F000
27 1000 endif
28 1000
29 1000 ifconst bankswitch_hotspot
30 1000 - if bankswitch_hotspot = $083F ; 0840 bankswitching hotspot
31 1000 - .byte 234 ; stop unexpected bankswitches
32 1000 endif
33 1000 endif
34 1000 game
35 1000 .
36 1000 ;
37 1000
38 1000 .
39 1000 ;
40 1000
41 1000 .
42 1000 ;
43 1000
44 1000 .
45 1000 ;
46 1000
47 1000 .
48 1000 ;
49 1000
50 1000 .
51 1000 ;
52 1000
53 1000 .
54 1000 ;
55 1000
56 1000 .L00 ; includesfile multisprite_bankswitch.inc
57 1000
58 1000 .L01 ; set kernel_options no_blank_lines
59 1000
60 1000 .
61 1000 ;
62 1000
63 1000 .L02 ; set kernel multisprite
64 1000
65 1000 .L03 ; set romsize 8k
66 1000
67 1000 .
68 1000 ;
69 1000
70 1000 .
71 1000 ;
72 1000
73 1000 .L04 ; const pfscore = 0
74 1000
75 1000 .
76 1000 ;
77 1000
78 1000 .
79 1000 ;
80 1000
81 1000 .
82 1000 ;
83 1000
84 1000 .L05 ; dim sound = t : sound = 32
85 1000
86 1000 a9 20 LDA #32
87 1002 85 ea STA sound
88 1004 .
89 1004 ;
90 1004
91 1004 .L06 ; dim reducing_lives = p : p = 0
92 1004
93 1004 a9 00 LDA #0
94 1006 85 e6 STA p
95 1008 .
96 1008 ;
97 1008
98 1008 .L07 ; pfscore2 = %00101010
99 1008
100 1008 a9 2a LDA #%00101010
101 100a 85 c2 STA pfscore2
102 100c .
103 100c ;
104 100c
105 100c .
106 100c ;
107 100c
108 100c .L08 ; dim inv_x = a : a = 84
109 100c
110 100c a9 54 LDA #84
111 100e 85 d7 STA a
112 1010 .L09 ; dim inv_y = b : b = 76
113 1010
114 1010 a9 4c LDA #76
115 1012 85 d8 STA b
116 1014 .L010 ; dim inv_delay = c : c = 0
117 1014
118 1014 a9 00 LDA #0
119 1016 85 d9 STA c
120 1018 .L011 ; dim inv_dir = f : f = 1
121 1018
122 1018 a9 01 LDA #1
123 101a 85 dc STA f
124 101c .L012 ; dim inv_shot_x = g : g = inv_x
125 101c
126 101c a5 d7 LDA inv_x
127 101e 85 dd STA g
128 1020 .L013 ; dim inv_shot_y = h : h = inv_y
129 1020
130 1020 a5 d8 LDA inv_y
131 1022 85 de STA h
132 1024 .L014 ; dim inv_fire_delay = k : k = 0
133 1024
134 1024 a9 00 LDA #0
135 1026 85 e1 STA k
136 1028 .L015 ; dim inv_fired = l : l = 0
137 1028
138 1028 a9 00 LDA #0
139 102a 85 e2 STA l
140 102c .L016 ; dim inv_hit = n : n = 0
141 102c
142 102c a9 00 LDA #0
143 102e 85 e4 STA n
144 1030 .L017 ; dim inv_blast_delay = o : o = 0
145 1030
146 1030 a9 00 LDA #0
147 1032 85 e5 STA o
148 1034 .
149 1034 ;
150 1034
151 1034 .
152 1034 ;
153 1034
154 1034 .L018 ; dim tur_x = d : d = 84
155 1034
156 1034 a9 54 LDA #84
157 1036 85 da STA d
158 1038 .L019 ; dim tur_y = e : e = 14
159 1038
160 1038 a9 0e LDA #14
161 103a 85 db STA e
162 103c .L020 ; dim shot_x = i : i = tur_x
163 103c
164 103c a5 da LDA tur_x
165 103e 85 df STA i
166 1040 .L021 ; dim shot_y = j : j = tur_y
167 1040
168 1040 a5 db LDA tur_y
169 1042 85 e0 STA j
170 1044 .L022 ; dim tur_fired = m : m = 0
171 1044
172 1044 a9 00 LDA #0
173 1046 85 e3 STA m
174 1048 .L023 ; dim tur_hit = q : q = 0
175 1048
176 1048 a9 00 LDA #0
177 104a 85 e7 STA q
178 104c .L024 ; dim tur_anim_playing = r : r = 0
179 104c
180 104c a9 00 LDA #0
181 104e 85 e8 STA r
182 1050 .L025 ; dim tur_anim_frame = s : s = 0
183 1050
184 1050 a9 00 LDA #0
185 1052 85 e9 STA s
186 1054 .
187 1054 ;
188 1054
189 1054 .
190 1054 ;
191 1054
192 1054 .
193 1054 ;
194 1054
195 1054 .
196 1054 ;
197 1054
198 1054 .
199 1054 ;
200 1054
201 1054 .main
202 1054 ; main
203 1054
204 1054 .
205 1054 ;
206 1054
207 1054 .
208 1054 ;
209 1054
210 1054 .L026 ; AUDV0 = 0
211 1054
212 1054 a9 00 LDA #0
213 1056 85 19 STA AUDV0
214 1058 .
215 1058 ;
216 1058
217 1058 .
218 1058 ;
219 1058
220 1058 .
221 1058 ;
222 1058
223 1058 .L027 ; if sound <= 31 then sound = sound + 1 : AUDC0 = 8 : AUDV0 = 4 : AUDF0 = sound - 1
224 1058
225 1058 a9 1f LDA #31
226 105a c5 ea CMP sound
227 105c 90 11 BCC .skipL027
228 105e .condpart0
229 105e e6 ea INC sound
230 1060 a9 08 LDA #8
231 1062 85 15 STA AUDC0
232 1064 a9 04 LDA #4
233 1066 85 19 STA AUDV0
234 1068 a5 ea LDA sound
235 106a 38 SEC
236 106b e9 01 SBC #1
237 106d 85 17 STA AUDF0
238 106f .skipL027
239 106f .
240 106f ;
241 106f
242 106f .L028 ; if sound >= 33 && sound <= 64 then sound = sound + 1 : AUDC0 = 7 : AUDV0 = 4 : AUDF0 = sound - 34
243 106f
244 106f a5 ea LDA sound
245 1071 c9 21 CMP #33
246 1073 90 17 BCC .skipL028
247 1075 .condpart1
248 1075 a9 40 LDA #64
249 1077 c5 ea CMP sound
250 1079 90 11 BCC .skip1then
251 107b .condpart2
252 107b e6 ea INC sound
253 107d a9 07 LDA #7
254 107f 85 15 STA AUDC0
255 1081 a9 04 LDA #4
256 1083 85 19 STA AUDV0
257 1085 a5 ea LDA sound
258 1087 38 SEC
259 1088 e9 22 SBC #34
260 108a 85 17 STA AUDF0
261 108c .skip1then
262 108c .skipL028
263 108c .
264 108c ;
265 108c
266 108c .L029 ; if sound >= 66 && sound <= 97 then sound = sound + 1 : AUDC0 = 2 : AUDV0 = 4 : AUDF0 = sound - 67
267 108c
268 108c a5 ea LDA sound
269 108e c9 42 CMP #66
270 1090 90 17 BCC .skipL029
271 1092 .condpart3
272 1092 a9 61 LDA #97
273 1094 c5 ea CMP sound
274 1096 90 11 BCC .skip3then
275 1098 .condpart4
276 1098 e6 ea INC sound
277 109a a9 02 LDA #2
278 109c 85 15 STA AUDC0
279 109e a9 04 LDA #4
280 10a0 85 19 STA AUDV0
281 10a2 a5 ea LDA sound
282 10a4 38 SEC
283 10a5 e9 43 SBC #67
284 10a7 85 17 STA AUDF0
285 10a9 .skip3then
286 10a9 .skipL029
287 10a9 .
288 10a9 ;
289 10a9
290 10a9 .
291 10a9 ;
292 10a9
293 10a9 .
294 10a9 ;
295 10a9
296 10a9 .
297 10a9 ;
298 10a9
299 10a9 .
300 10a9 ;
301 10a9
302 10a9 .
303 10a9 ;
304 10a9
305 10a9 .
306 10a9 ;
307 10a9
308 10a9 .L030 ; if !joy0fire && !joy0up && !joy0down && !joy0left && !joy0right then u{3} = 1
309 10a9
310 10a9 24 0c bit INPT4
311 10ab 10 1e BPL .skipL030
312 10ad .condpart5
313 10ad a9 10 lda #$10
314 10af 2c 80 02 bit SWCHA
315 10b2 f0 17 BEQ .skip5then
316 10b4 .condpart6
317 10b4 a9 20 lda #$20
318 10b6 2c 80 02 bit SWCHA
319 10b9 f0 10 BEQ .skip6then
320 10bb .condpart7
321 10bb 2c 80 02 bit SWCHA
322 10be 50 0b BVC .skip7then
323 10c0 .condpart8
324 10c0 2c 80 02 bit SWCHA
325 10c3 10 06 BPL .skip8then
326 10c5 .condpart9
327 10c5 a5 eb LDA u
328 10c7 09 08 ORA #8
329 10c9 85 eb STA u
330 10cb .skip8then
331 10cb .skip7then
332 10cb .skip6then
333 10cb .skip5then
334 10cb .skipL030
335 10cb .
336 10cb ;
337 10cb
338 10cb .
339 10cb ;
340 10cb
341 10cb .L031 ; if tur_hit = 0 then gosub draw__move_turret
342 10cb
343 10cb a5 e7 LDA tur_hit
344 10cd c9 00 CMP #0
345 10cf d0 03 BNE .skipL031
346 10d1 .condpart10
347 10d1 20 2e d3 jsr .draw__move_turret
348 10d4
349 10d4 .skipL031
350 10d4 .L032 ; if tur_hit = 0 then gosub draw__move_turret_shot
351 10d4
352 10d4 a5 e7 LDA tur_hit
353 10d6 c9 00 CMP #0
354 10d8 d0 03 BNE .skipL032
355 10da .condpart11
356 10da 20 73 d3 jsr .draw__move_turret_shot
357 10dd
358 10dd .skipL032
359 10dd .L033 ; gosub draw__move_invader
360 10dd
361 10dd 20 1e d1 jsr .draw__move_invader
362 10e0
363 10e0 .L034 ; gosub draw__move_inv_shot
364 10e0
365 10e0 20 f0 d1 jsr .draw__move_inv_shot
366 10e3
367 10e3 .L035 ; gosub col_shot_inv
368 10e3
369 10e3 20 6f d2 jsr .col_shot_inv
370 10e6
371 10e6 .L036 ; gosub col_inv_shot_turret
372 10e6
373 10e6 20 e8 d3 jsr .col_inv_shot_turret
374 10e9
375 10e9 .L037 ; if tur_hit = 1 then gosub play_tur_anim
376 10e9
377 10e9 a5 e7 LDA tur_hit
378 10eb c9 01 CMP #1
379 10ed d0 03 BNE .skipL037
380 10ef .condpart12
381 10ef 20 28 d4 jsr .play_tur_anim
382 10f2
383 10f2 .skipL037
384 10f2 .
385 10f2 ;
386 10f2
387 10f2 .L038 ; if pfscore2 < 2 then goto game_over
388 10f2
389 10f2 a5 c2 LDA pfscore2
390 10f4 c9 02 CMP #2
391 10f6 b0 03 BCS .skipL038
392 10f8 .condpart13
393 10f8 4c bd d4 jmp .game_over
394 10fb
395 10fb .skipL038
396 10fb .
397 10fb ;
398 10fb
399 10fb .
400 10fb ;
401 10fb
402 10fb .L039 ; pfscorecolor = 196
403 10fb
404 10fb a9 c4 LDA #196
405 10fd 85 c0 STA pfscorecolor
406 10ff .
407 10ff ;
408 10ff
409 10ff .
410 10ff ;
411 10ff