-
Notifications
You must be signed in to change notification settings - Fork 0
/
invader_15.bas.lst
4912 lines (4024 loc) · 167 KB
/
invader_15.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_15.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_15.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_15.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_15.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 e3 tur_fired = m
5 3000 ???? 00 e0 shot_y = j
6 3000 ???? 00 df shot_x = i
7 3000 ???? 00 db tur_y = e
8 3000 ???? 00 da tur_x = d
9 3000 ???? 00 e5 inv_blast_delay = o
10 3000 ???? 00 e4 inv_hit = n
11 3000 ???? 00 e2 inv_fired = l
12 3000 ???? 00 e1 inv_fire_delay = k
13 3000 ???? 00 de inv_shot_y = h
14 3000 ???? 00 dd inv_shot_x = g
15 3000 ???? 00 dc inv_dir = f
16 3000 ???? 00 d9 inv_delay = c
17 3000 ???? 00 d8 inv_y = b
18 3000 ???? 00 d7 inv_x = a
19 3000 ???? 00 d4 _sc3 = score + 2
20 3000 ????
21 3000 ???? 00 01 bs_mask = 1
22 3000 ???? 00 08 bankswitch = 8
23 3000 ???? 1f f8 bankswitch_hotspot = $1FF8
24 3000 ???? 00 01 multisprite = 1
25 3000 ???? 00 01 no_blank_lines = 1
------- FILE C:\Atari2600Dev\my_projects\Invader_Atari_2600_Basic\invader_15.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 .
57 1000 ;
58 1000
59 1000 .L00 ; includesfile multisprite_bankswitch.inc
60 1000
61 1000 .L01 ; set kernel_options no_blank_lines
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 .
74 1000 ;
75 1000
76 1000 .L04 ; scorecolor = 14
77 1000
78 1000 a9 0e LDA #14
79 1002 85 d5 STA scorecolor
80 1004 .
81 1004 ;
82 1004
83 1004 .L05 ; dim _sc3 = score + 2
84 1004
85 1004 .
86 1004 ;
87 1004
88 1004 .
89 1004 ;
90 1004
91 1004 .L06 ; dim inv_x = a : a = 84
92 1004
93 1004 a9 54 LDA #84
94 1006 85 d7 STA a
95 1008 .L07 ; dim inv_y = b : b = 76
96 1008
97 1008 a9 4c LDA #76
98 100a 85 d8 STA b
99 100c .L08 ; dim inv_delay = c : c = 0
100 100c
101 100c a9 00 LDA #0
102 100e 85 d9 STA c
103 1010 .L09 ; dim inv_dir = f : f = 1
104 1010
105 1010 a9 01 LDA #1
106 1012 85 dc STA f
107 1014 .L010 ; dim inv_shot_x = g : g = 0
108 1014
109 1014 a9 00 LDA #0
110 1016 85 dd STA g
111 1018 .L011 ; dim inv_shot_y = h : h = 0
112 1018
113 1018 a9 00 LDA #0
114 101a 85 de STA h
115 101c .L012 ; dim inv_fire_delay = k : k = 0
116 101c
117 101c a9 00 LDA #0
118 101e 85 e1 STA k
119 1020 .L013 ; dim inv_fired = l : l = 0
120 1020
121 1020 a9 00 LDA #0
122 1022 85 e2 STA l
123 1024 .L014 ; dim inv_hit = n : n = 0
124 1024
125 1024 a9 00 LDA #0
126 1026 85 e4 STA n
127 1028 .L015 ; dim inv_blast_delay = o : o = 0
128 1028
129 1028 a9 00 LDA #0
130 102a 85 e5 STA o
131 102c .
132 102c ;
133 102c
134 102c .
135 102c ;
136 102c
137 102c .L016 ; dim tur_x = d : d = 84
138 102c
139 102c a9 54 LDA #84
140 102e 85 da STA d
141 1030 .L017 ; dim tur_y = e : e = 14
142 1030
143 1030 a9 0e LDA #14
144 1032 85 db STA e
145 1034 .L018 ; dim shot_x = i : i = tur_x
146 1034
147 1034 a5 da LDA tur_x
148 1036 85 df STA i
149 1038 .L019 ; dim shot_y = j : j = tur_y
150 1038
151 1038 a5 db LDA tur_y
152 103a 85 e0 STA j
153 103c .L020 ; dim tur_fired = m : m = 0
154 103c
155 103c a9 00 LDA #0
156 103e 85 e3 STA m
157 1040 .
158 1040 ;
159 1040
160 1040 .
161 1040 ;
162 1040
163 1040 .
164 1040 ;
165 1040
166 1040 .main
167 1040 ; main
168 1040
169 1040 .
170 1040 ;
171 1040
172 1040 .L021 ; gosub draw__move_turret
173 1040
174 1040 20 73 d2 jsr .draw__move_turret
175 1043
176 1043 .L022 ; gosub draw__move_turret_shot
177 1043
178 1043 20 b2 d2 jsr .draw__move_turret_shot
179 1046
180 1046 .L023 ; gosub draw__move_invader
181 1046
182 1046 20 73 d0 jsr .draw__move_invader
183 1049
184 1049 .L024 ; gosub draw__move_inv_shot
185 1049
186 1049 20 45 d1 jsr .draw__move_inv_shot
187 104c
188 104c .L025 ; gosub col_shot_inv
189 104c
190 104c 20 c4 d1 jsr .col_shot_inv
191 104f
192 104f .
193 104f ;
194 104f
195 104f .L026 ; if _sc3 >= 70 then goto game_over
196 104f
197 104f a5 d4 LDA _sc3
198 1051 c9 46 CMP #70
199 1053 90 03 BCC .skipL026
200 1055 .condpart0
201 1055 4c 15 d3 jmp .game_over
202 1058
203 1058 .skipL026
204 1058 .
205 1058 ;
206 1058
207 1058 .L027 ; drawscreen
208 1058
209 1058 85 d1 sta temp7
210 105a a9 d0 lda #>(ret_point1-1)
211 105c 48 pha
212 105d a9 6f lda #<(ret_point1-1)
213 105f 48 pha
214 1060 a9 f0 lda #>(drawscreen-1)
215 1062 48 pha
216 1063 a9 39 lda #<(drawscreen-1)
217 1065 48 pha
218 1066 a5 d1 lda temp7
219 1068 48 pha
220 1069 8a txa
221 106a 48 pha
222 106b a2 02 ldx #2
223 106d 4c eb ff jmp BS_jsr
224 1070 ret_point1
225 1070 .
226 1070 ;
227 1070
228 1070 .L028 ; goto main
229 1070
230 1070 4c 40 d0 jmp .main
231 1073
232 1073 .
233 1073 ;
234 1073
235 1073 .
236 1073 ;
237 1073
238 1073 .
239 1073 ;
240 1073
241 1073 .
242 1073 ;
243 1073
244 1073 .
245 1073 ;
246 1073
247 1073 .
248 1073 ;
249 1073
250 1073 .
251 1073 ;
252 1073
253 1073 .draw__move_invader
254 1073 ; draw__move_invader
255 1073
256 1073 .
257 1073 ;
258 1073
259 1073 .L029 ; inv_delay = inv_delay + 1
260 1073
261 1073 e6 d9 INC inv_delay
262 1075 .
263 1075 ;
264 1075
265 1075 .
266 1075 ;
267 1075
268 1075 .L030 ; if inv_delay = 15 && inv_hit = 0 then player0:
269 1075
270 1075 a5 d9 LDA inv_delay
271 1077 c9 0f CMP #15
272 1079 d0 12 BNE .skipL030
273 107b .condpart1
274 107b a5 e4 LDA inv_hit
275 107d c9 00 CMP #0
276 107f d0 0c BNE .skip1then
277 1081 .condpart2
278 1081 a2 5a LDX #<player2then_0
279 1083 86 a2 STX player0pointerlo
280 1085 a9 f4 LDA #>player2then_0
281 1087 85 a3 STA player0pointerhi
282 1089 a9 09 LDA #9
283 108b 85 b0 STA player0height
284 108d .skip1then
285 108d .skipL030
286 108d .
287 108d ;
288 108d
289 108d .
290 108d ;
291 108d
292 108d .L031 ; if inv_delay = 30 && inv_hit = 0 then player0:
293 108d
294 108d a5 d9 LDA inv_delay
295 108f c9 1e CMP #30
296 1091 d0 12 BNE .skipL031
297 1093 .condpart3
298 1093 a5 e4 LDA inv_hit
299 1095 c9 00 CMP #0
300 1097 d0 0c BNE .skip3then
301 1099 .condpart4
302 1099 a2 63 LDX #<player4then_0
303 109b 86 a2 STX player0pointerlo
304 109d a9 f4 LDA #>player4then_0
305 109f 85 a3 STA player0pointerhi
306 10a1 a9 09 LDA #9
307 10a3 85 b0 STA player0height
308 10a5 .skip3then
309 10a5 .skipL031
310 10a5 .
311 10a5 ;
312 10a5
313 10a5 .L032 ; if inv_delay > 30 then inv_delay = 0
314 10a5
315 10a5 a9 1e LDA #30
316 10a7 c5 d9 CMP inv_delay
317 10a9 b0 04 BCS .skipL032
318 10ab .condpart5
319 10ab a9 00 LDA #0
320 10ad 85 d9 STA inv_delay
321 10af .skipL032
322 10af .
323 10af ;
324 10af
325 10af .
326 10af ;
327 10af
328 10af .L033 ; COLUP0 = 52
329 10af
330 10af a9 34 LDA #52
331 10b1 85 06 STA COLUP0
332 10b3 .
333 10b3 ;
334 10b3
335 10b3 .
336 10b3 ;
337 10b3
338 10b3 .L034 ; if inv_hit = 0 && inv_dir = 1 && inv_delay = 15 then inv_x = inv_x + 1
339 10b3
340 10b3 a5 e4 LDA inv_hit
341 10b5 c9 00 CMP #0
342 10b7 d0 0e BNE .skipL034
343 10b9 .condpart6
344 10b9 a5 dc LDA inv_dir
345 10bb c9 01 CMP #1
346 10bd d0 08 BNE .skip6then
347 10bf .condpart7
348 10bf a5 d9 LDA inv_delay
349 10c1 c9 0f CMP #15
350 10c3 d0 02 BNE .skip7then
351 10c5 .condpart8
352 10c5 e6 d7 INC inv_x
353 10c7 .skip7then
354 10c7 .skip6then
355 10c7 .skipL034
356 10c7 .L035 ; if inv_hit = 0 && inv_dir = 1 && inv_delay = 30 then inv_x = inv_x + 1
357 10c7
358 10c7 a5 e4 LDA inv_hit
359 10c9 c9 00 CMP #0
360 10cb d0 0e BNE .skipL035
361 10cd .condpart9
362 10cd a5 dc LDA inv_dir
363 10cf c9 01 CMP #1
364 10d1 d0 08 BNE .skip9then
365 10d3 .condpart10
366 10d3 a5 d9 LDA inv_delay
367 10d5 c9 1e CMP #30
368 10d7 d0 02 BNE .skip10then
369 10d9 .condpart11
370 10d9 e6 d7 INC inv_x
371 10db .skip10then
372 10db .skip9then
373 10db .skipL035
374 10db .
375 10db ;
376 10db
377 10db .L036 ; if inv_x > 143 then inv_dir = 0 : inv_x = 143 : inv_y = inv_y - 5
378 10db
379 10db a9 8f LDA #143
380 10dd c5 d7 CMP inv_x
381 10df b0 0f BCS .skipL036
382 10e1 .condpart12
383 10e1 a9 00 LDA #0
384 10e3 85 dc STA inv_dir
385 10e5 a9 8f LDA #143
386 10e7 85 d7 STA inv_x
387 10e9 a5 d8 LDA inv_y
388 10eb 38 SEC
389 10ec e9 05 SBC #5
390 10ee 85 d8 STA inv_y
391 10f0 .skipL036
392 10f0 .
393 10f0 ;
394 10f0
395 10f0 .
396 10f0 ;
397 10f0
398 10f0 .L037 ; if inv_hit = 0 && inv_dir = 0 && inv_delay = 15 then inv_x = inv_x - 1
399 10f0
400 10f0 a5 e4 LDA inv_hit
401 10f2 c9 00 CMP #0
402 10f4 d0 0e BNE .skipL037
403 10f6 .condpart13
404 10f6 a5 dc LDA inv_dir
405 10f8 c9 00 CMP #0
406 10fa d0 08 BNE .skip13then
407 10fc .condpart14
408 10fc a5 d9 LDA inv_delay
409 10fe c9 0f CMP #15
410 1100 d0 02 BNE .skip14then
411 1102 .condpart15
412 1102 c6 d7 DEC inv_x
413 1104 .skip14then
414 1104 .skip13then
415 1104 .skipL037
416 1104 .L038 ; if inv_hit = 0 && inv_dir = 0 && inv_delay = 30 then inv_x = inv_x - 1