-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path10b_MoveAnAnimatedSprite.bas.lst
4291 lines (3413 loc) · 156 KB
/
10b_MoveAnAnimatedSprite.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\10b_MoveAnAnimatedSprite.bas.asm LEVEL 1 PASS 2
1 10000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details.
2 10000 ????
3 10000 ???? processor 6502
------- FILE vcs.h LEVEL 2 PASS 2
0 10000 ???? include "vcs.h"
1 10000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details.
2 10000 ????
3 10000 ???? ; VCS.H
4 10000 ???? ; Version 1.05, 13/November/2003
5 10000 ????
6 10000 ???? 00 69 VERSION_VCS = 105
7 10000 ????
8 10000 ???? ; THIS IS A PRELIMINARY RELEASE OF *THE* "STANDARD" VCS.H
9 10000 ???? ; THIS FILE IS EXPLICITLY SUPPORTED AS A DASM-PREFERRED COMPANION FILE
10 10000 ???? ; PLEASE DO *NOT* REDISTRIBUTE THIS FILE!
11 10000 ???? ;
12 10000 ???? ; This file defines hardware registers and memory mapping for the
13 10000 ???? ; Atari 2600. It is distributed as a companion machine-specific support package
14 10000 ???? ; for the DASM compiler. Updates to this file, DASM, and associated tools are
15 10000 ???? ; available at at http://www.atari2600.org/dasm
16 10000 ???? ;
17 10000 ???? ; Many thanks to the original author(s) of this file, and to everyone who has
18 10000 ???? ; contributed to understanding the Atari 2600. If you take issue with the
19 10000 ???? ; contents, or naming of registers, please write to me ([email protected])
20 10000 ???? ; with your views. Please contribute, if you think you can improve this
21 10000 ???? ; file!
22 10000 ???? ;
23 10000 ???? ; Latest Revisions...
24 10000 ???? ; 1.05 13/NOV/2003 - Correction to 1.04 - now functions as requested by MR.
25 10000 ???? ; - Added VERSION_VCS equate (which will reflect 100x version #)
26 10000 ???? ; This will allow conditional code to verify VCS.H being
27 10000 ???? ; used for code assembly.
28 10000 ???? ; 1.04 12/NOV/2003 Added TIA_BASE_WRITE_ADDRESS and TIA_BASE_READ_ADDRESS for
29 10000 ???? ; convenient disassembly/reassembly compatibility for hardware
30 10000 ???? ; mirrored reading/writing differences. This is more a
31 10000 ???? ; readability issue, and binary compatibility with disassembled
32 10000 ???? ; and reassembled sources. Per Manuel Rotschkar's suggestion.
33 10000 ???? ; 1.03 12/MAY/2003 Added SEG segment at end of file to fix old-code compatibility
34 10000 ???? ; which was broken by the use of segments in this file, as
35 10000 ???? ; reported by Manuel Polik on [stella] 11/MAY/2003
36 10000 ???? ; 1.02 22/MAR/2003 Added TIMINT($285)
37 10000 ???? ; 1.01 Constant offset added to allow use for 3F-style bankswitching
38 10000 ???? ; - define TIA_BASE_ADDRESS as $40 for Tigervision carts, otherwise
39 10000 ???? ; it is safe to leave it undefined, and the base address will
40 10000 ???? ; be set to 0. Thanks to Eckhard Stolberg for the suggestion.
41 10000 ???? ; Note, may use -DLABEL=EXPRESSION to define TIA_BASE_ADDRESS
42 10000 ???? ; - register definitions are now generated through assignment
43 10000 ???? ; in uninitialised segments. This allows a changeable base
44 10000 ???? ; address architecture.
45 10000 ???? ; 1.0 22/MAR/2003 Initial release
46 10000 ????
47 10000 ????
48 10000 ???? ;-------------------------------------------------------------------------------
49 10000 ????
50 10000 ???? ; TIA_BASE_ADDRESS
51 10000 ???? ; The TIA_BASE_ADDRESS defines the base address of access to TIA registers.
52 10000 ???? ; Normally 0, the base address should (externally, before including this file)
53 10000 ???? ; be set to $40 when creating 3F-bankswitched (and other?) cartridges.
54 10000 ???? ; The reason is that this bankswitching scheme treats any access to locations
55 10000 ???? ; < $40 as a bankswitch.
56 10000 ????
57 10000 ???? - IFNCONST TIA_BASE_ADDRESS
58 10000 ???? -TIA_BASE_ADDRESS = 0
59 10000 ???? ENDIF
60 10000 ????
61 10000 ???? ; Note: The address may be defined on the command-line using the -D switch, eg:
62 10000 ???? ; dasm.exe code.asm -DTIA_BASE_ADDRESS=$40 -f3 -v5 -ocode.bin
63 10000 ???? ; *OR* by declaring the label before including this file, eg:
64 10000 ???? ; TIA_BASE_ADDRESS = $40
65 10000 ???? ; include "vcs.h"
66 10000 ????
67 10000 ???? ; Alternate read/write address capability - allows for some disassembly compatibility
68 10000 ???? ; usage ; to allow reassembly to binary perfect copies). This is essentially catering
69 10000 ???? ; for the mirrored ROM hardware registers.
70 10000 ????
71 10000 ???? ; Usage: As per above, define the TIA_BASE_READ_ADDRESS and/or TIA_BASE_WRITE_ADDRESS
72 10000 ???? ; using the -D command-line switch, as required. If the addresses are not defined,
73 10000 ???? ; they defaut to the TIA_BASE_ADDRESS.
74 10000 ????
75 10000 ???? - IFNCONST TIA_BASE_READ_ADDRESS
76 10000 ???? -TIA_BASE_READ_ADDRESS = TIA_BASE_ADDRESS
77 10000 ???? ENDIF
78 10000 ????
79 10000 ???? - IFNCONST TIA_BASE_WRITE_ADDRESS
80 10000 ???? -TIA_BASE_WRITE_ADDRESS = TIA_BASE_ADDRESS
81 10000 ???? ENDIF
82 10000 ????
83 10000 ???? ;-------------------------------------------------------------------------------
84 10000 ????
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 10000 ???? SEG
201 10000 ????
202 10000 ???? ; EOF
------- FILE C:\Atari2600Dev\my_projects\Invader_Atari_2600_Basic\10b_MoveAnAnimatedSprite.bas.asm
------- FILE macro.h LEVEL 2 PASS 2
0 10000 ???? include "macro.h"
1 10000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details.
2 10000 ????
3 10000 ???? ; MACRO.H
4 10000 ???? ; Version 1.05, 13/NOVEMBER/2003
5 10000 ????
6 10000 ???? 00 69 VERSION_MACRO = 105
7 10000 ????
8 10000 ???? ;
9 10000 ???? ; THIS FILE IS EXPLICITLY SUPPORTED AS A DASM-PREFERRED COMPANION FILE
10 10000 ???? ; PLEASE DO *NOT* REDISTRIBUTE MODIFIED VERSIONS OF THIS FILE!
11 10000 ???? ;
12 10000 ???? ; This file defines DASM macros useful for development for the Atari 2600.
13 10000 ???? ; It is distributed as a companion machine-specific support package
14 10000 ???? ; for the DASM compiler. Updates to this file, DASM, and associated tools are
15 10000 ???? ; available at at http://www.atari2600.org/dasm
16 10000 ???? ;
17 10000 ???? ; Many thanks to the people who have contributed. If you take issue with the
18 10000 ???? ; contents, or would like to add something, please write to me
19 10000 ???? ; ([email protected]) with your contribution.
20 10000 ???? ;
21 10000 ???? ; Latest Revisions...
22 10000 ???? ;
23 10000 ???? ; 1.05 14/NOV/2003 - Added VERSION_MACRO equate (which will reflect 100x version #)
24 10000 ???? ; This will allow conditional code to verify MACRO.H being
25 10000 ???? ; used for code assembly.
26 10000 ???? ; 1.04 13/NOV/2003 - SET_POINTER macro added (16-bit address load)
27 10000 ???? ;
28 10000 ???? ; 1.03 23/JUN/2003 - CLEAN_START macro added - clears TIA, RAM, registers
29 10000 ???? ;
30 10000 ???? ; 1.02 14/JUN/2003 - VERTICAL_SYNC macro added
31 10000 ???? ; (standardised macro for vertical synch code)
32 10000 ???? ; 1.01 22/MAR/2003 - SLEEP macro added.
33 10000 ???? ; - NO_ILLEGAL_OPCODES switch implemented
34 10000 ???? ; 1.0 22/MAR/2003 Initial release
35 10000 ????
36 10000 ???? ; Note: These macros use illegal opcodes. To disable illegal opcode usage,
37 10000 ???? ; define the symbol NO_ILLEGAL_OPCODES (-DNO_ILLEGAL_OPCODES=1 on command-line).
38 10000 ???? ; If you do not allow illegal opcode usage, you must include this file
39 10000 ???? ; *after* including VCS.H (as the non-illegal opcodes access hardware
40 10000 ???? ; registers and require them to be defined first).
41 10000 ????
42 10000 ???? ; Available macros...
43 10000 ???? ; SLEEP n - sleep for n cycles
44 10000 ???? ; VERTICAL_SYNC - correct 3 scanline vertical synch code
45 10000 ???? ; CLEAN_START - set machine to known state on startup
46 10000 ???? ; SET_POINTER - load a 16-bit absolute to a 16-bit variable
47 10000 ????
48 10000 ???? ;-------------------------------------------------------------------------------
49 10000 ???? ; SLEEP duration
50 10000 ???? ; Original author: Thomas Jentzsch
51 10000 ???? ; Inserts code which takes the specified number of cycles to execute. This is
52 10000 ???? ; useful for code where precise timing is required.
53 10000 ???? ; ILLEGAL-OPCODE VERSION DOES NOT AFFECT FLAGS OR REGISTERS.
54 10000 ???? ; LEGAL OPCODE VERSION MAY AFFECT FLAGS
55 10000 ???? ; Uses illegal opcode (DASM 2.20.01 onwards).
56 10000 ????
57 10000 ???? MAC sleep
58 10000 ???? .CYCLES SET {1}
59 10000 ????
60 10000 ???? IF .CYCLES < 2
61 10000 ???? ECHO "MACRO ERROR: 'SLEEP': Duration must be > 1"
62 10000 ???? ERR
63 10000 ???? ENDIF
64 10000 ????
65 10000 ???? IF .CYCLES & 1
66 10000 ???? IFNCONST NO_ILLEGAL_OPCODES
67 10000 ???? nop 0
68 10000 ???? ELSE
69 10000 ???? bit VSYNC
70 10000 ???? ENDIF
71 10000 ???? .CYCLES SET .CYCLES - 3
72 10000 ???? ENDIF
73 10000 ????
74 10000 ???? REPEAT .CYCLES / 2
75 10000 ???? nop
76 10000 ???? REPEND
77 10000 ???? ENDM ;usage: SLEEP n (n>1)
78 10000 ????
79 10000 ???? ;-------------------------------------------------------------------------------
80 10000 ???? ; VERTICAL_SYNC
81 10000 ???? ; Original author: Manuel Polik
82 10000 ???? ; Inserts the code required for a proper 3 scannline
83 10000 ???? ; vertical sync sequence
84 10000 ???? ;
85 10000 ???? ; Note: Alters the accumulator
86 10000 ???? ;
87 10000 ???? ; IN:
88 10000 ???? ; OUT: A = 1
89 10000 ????
90 10000 ???? MAC vertical_sync
91 10000 ???? LDA #$02 ; A = VSYNC enable
92 10000 ???? STA WSYNC ; Finish current line
93 10000 ???? STA VSYNC ; Start vertical sync
94 10000 ???? STA WSYNC ; 1st line vertical sync
95 10000 ???? STA WSYNC ; 2nd line vertical sync
96 10000 ???? LSR ; A = VSYNC disable
97 10000 ???? STA WSYNC ; 3rd line vertical sync
98 10000 ???? STA VSYNC ; Stop vertical sync
99 10000 ???? ENDM
100 10000 ????
101 10000 ???? ;-------------------------------------------------------------------------------
102 10000 ???? ; CLEAN_START
103 10000 ???? ; Original author: Andrew Davie
104 10000 ???? ; Standardised start-up code, clears stack, all TIA registers and RAM to 0
105 10000 ???? ; Sets stack pointer to $FF, and all registers to 0
106 10000 ???? ; Sets decimal mode off, sets interrupt flag (kind of un-necessary)
107 10000 ???? ; Use as very first section of code on boot (ie: at reset)
108 10000 ???? ; Code written to minimise total ROM usage - uses weird 6502 knowledge :)
109 10000 ????
110 10000 ???? MAC clean_start
111 10000 ???? sei
112 10000 ???? cld
113 10000 ????
114 10000 ???? ldx #0
115 10000 ???? txa
116 10000 ???? tay
117 10000 ???? .CLEAR_STACK dex
118 10000 ???? txs
119 10000 ???? pha
120 10000 ???? bne .CLEAR_STACK ; SP=$FF, X = A = Y = 0
121 10000 ????
122 10000 ???? ENDM
123 10000 ????
124 10000 ???? ;-------------------------------------------------------
125 10000 ???? ; SET_POINTER
126 10000 ???? ; Original author: Manuel Rotschkar
127 10000 ???? ;
128 10000 ???? ; Sets a 2 byte RAM pointer to an absolute address.
129 10000 ???? ;
130 10000 ???? ; Usage: SET_POINTER pointer, address
131 10000 ???? ; Example: SET_POINTER SpritePTR, SpriteData
132 10000 ???? ;
133 10000 ???? ; Note: Alters the accumulator, NZ flags
134 10000 ???? ; IN 1: 2 byte RAM location reserved for pointer
135 10000 ???? ; IN 2: absolute address
136 10000 ????
137 10000 ???? MAC set_pointer
138 10000 ???? .POINTER SET {1}
139 10000 ???? .ADDRESS SET {2}
140 10000 ????
141 10000 ???? LDA #<.ADDRESS ; Get Lowbyte of Address
142 10000 ???? STA .POINTER ; Store in pointer
143 10000 ???? LDA #>.ADDRESS ; Get Hibyte of Address
144 10000 ???? STA .POINTER+1 ; Store in pointer+1
145 10000 ????
146 10000 ???? ENDM
147 10000 ????
148 10000 ???? ; EOF
------- FILE C:\Atari2600Dev\my_projects\Invader_Atari_2600_Basic\10b_MoveAnAnimatedSprite.bas.asm
------- FILE 2600basic.h LEVEL 2 PASS 2
0 10000 ???? include "2600basic.h"
1 10000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details.
2 10000 ????
3 10000 ???? processor 6502
------- FILE vcs.h LEVEL 3 PASS 2
0 10000 ???? include "vcs.h"
1 10000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details.
2 10000 ????
3 10000 ???? ; VCS.H
4 10000 ???? ; Version 1.05, 13/November/2003
5 10000 ????
6 10000 ???? 00 69 VERSION_VCS = 105
7 10000 ????
8 10000 ???? ; THIS IS A PRELIMINARY RELEASE OF *THE* "STANDARD" VCS.H
9 10000 ???? ; THIS FILE IS EXPLICITLY SUPPORTED AS A DASM-PREFERRED COMPANION FILE
10 10000 ???? ; PLEASE DO *NOT* REDISTRIBUTE THIS FILE!
11 10000 ???? ;
12 10000 ???? ; This file defines hardware registers and memory mapping for the
13 10000 ???? ; Atari 2600. It is distributed as a companion machine-specific support package
14 10000 ???? ; for the DASM compiler. Updates to this file, DASM, and associated tools are
15 10000 ???? ; available at at http://www.atari2600.org/dasm
16 10000 ???? ;
17 10000 ???? ; Many thanks to the original author(s) of this file, and to everyone who has
18 10000 ???? ; contributed to understanding the Atari 2600. If you take issue with the
19 10000 ???? ; contents, or naming of registers, please write to me ([email protected])
20 10000 ???? ; with your views. Please contribute, if you think you can improve this
21 10000 ???? ; file!
22 10000 ???? ;
23 10000 ???? ; Latest Revisions...
24 10000 ???? ; 1.05 13/NOV/2003 - Correction to 1.04 - now functions as requested by MR.
25 10000 ???? ; - Added VERSION_VCS equate (which will reflect 100x version #)
26 10000 ???? ; This will allow conditional code to verify VCS.H being
27 10000 ???? ; used for code assembly.
28 10000 ???? ; 1.04 12/NOV/2003 Added TIA_BASE_WRITE_ADDRESS and TIA_BASE_READ_ADDRESS for
29 10000 ???? ; convenient disassembly/reassembly compatibility for hardware
30 10000 ???? ; mirrored reading/writing differences. This is more a
31 10000 ???? ; readability issue, and binary compatibility with disassembled
32 10000 ???? ; and reassembled sources. Per Manuel Rotschkar's suggestion.
33 10000 ???? ; 1.03 12/MAY/2003 Added SEG segment at end of file to fix old-code compatibility
34 10000 ???? ; which was broken by the use of segments in this file, as
35 10000 ???? ; reported by Manuel Polik on [stella] 11/MAY/2003
36 10000 ???? ; 1.02 22/MAR/2003 Added TIMINT($285)
37 10000 ???? ; 1.01 Constant offset added to allow use for 3F-style bankswitching
38 10000 ???? ; - define TIA_BASE_ADDRESS as $40 for Tigervision carts, otherwise
39 10000 ???? ; it is safe to leave it undefined, and the base address will
40 10000 ???? ; be set to 0. Thanks to Eckhard Stolberg for the suggestion.
41 10000 ???? ; Note, may use -DLABEL=EXPRESSION to define TIA_BASE_ADDRESS
42 10000 ???? ; - register definitions are now generated through assignment
43 10000 ???? ; in uninitialised segments. This allows a changeable base
44 10000 ???? ; address architecture.
45 10000 ???? ; 1.0 22/MAR/2003 Initial release
46 10000 ????
47 10000 ????
48 10000 ???? ;-------------------------------------------------------------------------------
49 10000 ????
50 10000 ???? ; TIA_BASE_ADDRESS
51 10000 ???? ; The TIA_BASE_ADDRESS defines the base address of access to TIA registers.
52 10000 ???? ; Normally 0, the base address should (externally, before including this file)
53 10000 ???? ; be set to $40 when creating 3F-bankswitched (and other?) cartridges.
54 10000 ???? ; The reason is that this bankswitching scheme treats any access to locations
55 10000 ???? ; < $40 as a bankswitch.
56 10000 ????
57 10000 ???? - IFNCONST TIA_BASE_ADDRESS
58 10000 ???? -TIA_BASE_ADDRESS = 0
59 10000 ???? ENDIF
60 10000 ????
61 10000 ???? ; Note: The address may be defined on the command-line using the -D switch, eg:
62 10000 ???? ; dasm.exe code.asm -DTIA_BASE_ADDRESS=$40 -f3 -v5 -ocode.bin
63 10000 ???? ; *OR* by declaring the label before including this file, eg:
64 10000 ???? ; TIA_BASE_ADDRESS = $40
65 10000 ???? ; include "vcs.h"
66 10000 ????
67 10000 ???? ; Alternate read/write address capability - allows for some disassembly compatibility
68 10000 ???? ; usage ; to allow reassembly to binary perfect copies). This is essentially catering
69 10000 ???? ; for the mirrored ROM hardware registers.
70 10000 ????
71 10000 ???? ; Usage: As per above, define the TIA_BASE_READ_ADDRESS and/or TIA_BASE_WRITE_ADDRESS
72 10000 ???? ; using the -D command-line switch, as required. If the addresses are not defined,
73 10000 ???? ; they defaut to the TIA_BASE_ADDRESS.
74 10000 ????
75 10000 ???? - IFNCONST TIA_BASE_READ_ADDRESS
76 10000 ???? -TIA_BASE_READ_ADDRESS = TIA_BASE_ADDRESS
77 10000 ???? ENDIF
78 10000 ????
79 10000 ???? - IFNCONST TIA_BASE_WRITE_ADDRESS
80 10000 ???? -TIA_BASE_WRITE_ADDRESS = TIA_BASE_ADDRESS
81 10000 ???? ENDIF
82 10000 ????
83 10000 ???? ;-------------------------------------------------------------------------------
84 10000 ????
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 10000 ???? SEG
201 10000 ????
202 10000 ???? ; EOF
------- FILE 2600basic.h
------- FILE macro.h LEVEL 3 PASS 2
0 10000 ???? include "macro.h"
1 10000 ???? ; Provided under the CC0 license. See the included LICENSE.txt for details.
2 10000 ????
3 10000 ???? ; MACRO.H
4 10000 ???? ; Version 1.05, 13/NOVEMBER/2003
5 10000 ????
6 10000 ???? 00 69 VERSION_MACRO = 105
7 10000 ????
8 10000 ???? ;
9 10000 ???? ; THIS FILE IS EXPLICITLY SUPPORTED AS A DASM-PREFERRED COMPANION FILE
10 10000 ???? ; PLEASE DO *NOT* REDISTRIBUTE MODIFIED VERSIONS OF THIS FILE!
11 10000 ???? ;
12 10000 ???? ; This file defines DASM macros useful for development for the Atari 2600.
13 10000 ???? ; It is distributed as a companion machine-specific support package
14 10000 ???? ; for the DASM compiler. Updates to this file, DASM, and associated tools are
15 10000 ???? ; available at at http://www.atari2600.org/dasm
16 10000 ???? ;
17 10000 ???? ; Many thanks to the people who have contributed. If you take issue with the
18 10000 ???? ; contents, or would like to add something, please write to me
19 10000 ???? ; ([email protected]) with your contribution.
20 10000 ???? ;
21 10000 ???? ; Latest Revisions...
22 10000 ???? ;
23 10000 ???? ; 1.05 14/NOV/2003 - Added VERSION_MACRO equate (which will reflect 100x version #)
24 10000 ???? ; This will allow conditional code to verify MACRO.H being
25 10000 ???? ; used for code assembly.
26 10000 ???? ; 1.04 13/NOV/2003 - SET_POINTER macro added (16-bit address load)
27 10000 ???? ;
28 10000 ???? ; 1.03 23/JUN/2003 - CLEAN_START macro added - clears TIA, RAM, registers
29 10000 ???? ;
30 10000 ???? ; 1.02 14/JUN/2003 - VERTICAL_SYNC macro added
31 10000 ???? ; (standardised macro for vertical synch code)
32 10000 ???? ; 1.01 22/MAR/2003 - SLEEP macro added.
33 10000 ???? ; - NO_ILLEGAL_OPCODES switch implemented
34 10000 ???? ; 1.0 22/MAR/2003 Initial release
35 10000 ????
36 10000 ???? ; Note: These macros use illegal opcodes. To disable illegal opcode usage,
37 10000 ???? ; define the symbol NO_ILLEGAL_OPCODES (-DNO_ILLEGAL_OPCODES=1 on command-line).
38 10000 ???? ; If you do not allow illegal opcode usage, you must include this file
39 10000 ???? ; *after* including VCS.H (as the non-illegal opcodes access hardware
40 10000 ???? ; registers and require them to be defined first).
41 10000 ????
42 10000 ???? ; Available macros...
43 10000 ???? ; SLEEP n - sleep for n cycles
44 10000 ???? ; VERTICAL_SYNC - correct 3 scanline vertical synch code
45 10000 ???? ; CLEAN_START - set machine to known state on startup
46 10000 ???? ; SET_POINTER - load a 16-bit absolute to a 16-bit variable
47 10000 ????
48 10000 ???? ;-------------------------------------------------------------------------------
49 10000 ???? ; SLEEP duration
50 10000 ???? ; Original author: Thomas Jentzsch
51 10000 ???? ; Inserts code which takes the specified number of cycles to execute. This is
52 10000 ???? ; useful for code where precise timing is required.
53 10000 ???? ; ILLEGAL-OPCODE VERSION DOES NOT AFFECT FLAGS OR REGISTERS.
54 10000 ???? ; LEGAL OPCODE VERSION MAY AFFECT FLAGS
55 10000 ???? ; Uses illegal opcode (DASM 2.20.01 onwards).
56 10000 ????
57 10000 ???? MAC sleep
58 10000 ???? .CYCLES SET {1}
59 10000 ????
60 10000 ???? IF .CYCLES < 2
61 10000 ???? ECHO "MACRO ERROR: 'SLEEP': Duration must be > 1"
62 10000 ???? ERR
63 10000 ???? ENDIF
64 10000 ????
65 10000 ???? IF .CYCLES & 1
66 10000 ???? IFNCONST NO_ILLEGAL_OPCODES
67 10000 ???? nop 0
68 10000 ???? ELSE
69 10000 ???? bit VSYNC
70 10000 ???? ENDIF
71 10000 ???? .CYCLES SET .CYCLES - 3
72 10000 ???? ENDIF
73 10000 ????
74 10000 ???? REPEAT .CYCLES / 2
75 10000 ???? nop
76 10000 ???? REPEND
77 10000 ???? ENDM ;usage: SLEEP n (n>1)
78 10000 ????
79 10000 ???? ;-------------------------------------------------------------------------------
80 10000 ???? ; VERTICAL_SYNC
81 10000 ???? ; Original author: Manuel Polik
82 10000 ???? ; Inserts the code required for a proper 3 scannline
83 10000 ???? ; vertical sync sequence
84 10000 ???? ;
85 10000 ???? ; Note: Alters the accumulator
86 10000 ???? ;
87 10000 ???? ; IN:
88 10000 ???? ; OUT: A = 1
89 10000 ????
90 10000 ???? MAC vertical_sync
91 10000 ???? LDA #$02 ; A = VSYNC enable
92 10000 ???? STA WSYNC ; Finish current line
93 10000 ???? STA VSYNC ; Start vertical sync
94 10000 ???? STA WSYNC ; 1st line vertical sync
95 10000 ???? STA WSYNC ; 2nd line vertical sync
96 10000 ???? LSR ; A = VSYNC disable
97 10000 ???? STA WSYNC ; 3rd line vertical sync
98 10000 ???? STA VSYNC ; Stop vertical sync
99 10000 ???? ENDM
100 10000 ????
101 10000 ???? ;-------------------------------------------------------------------------------
102 10000 ???? ; CLEAN_START
103 10000 ???? ; Original author: Andrew Davie
104 10000 ???? ; Standardised start-up code, clears stack, all TIA registers and RAM to 0
105 10000 ???? ; Sets stack pointer to $FF, and all registers to 0
106 10000 ???? ; Sets decimal mode off, sets interrupt flag (kind of un-necessary)
107 10000 ???? ; Use as very first section of code on boot (ie: at reset)
108 10000 ???? ; Code written to minimise total ROM usage - uses weird 6502 knowledge :)
109 10000 ????
110 10000 ???? MAC clean_start
111 10000 ???? sei
112 10000 ???? cld
113 10000 ????
114 10000 ???? ldx #0
115 10000 ???? txa
116 10000 ???? tay
117 10000 ???? .CLEAR_STACK dex
118 10000 ???? txs
119 10000 ???? pha
120 10000 ???? bne .CLEAR_STACK ; SP=$FF, X = A = Y = 0
121 10000 ????
122 10000 ???? ENDM
123 10000 ????
124 10000 ???? ;-------------------------------------------------------
125 10000 ???? ; SET_POINTER
126 10000 ???? ; Original author: Manuel Rotschkar
127 10000 ???? ;
128 10000 ???? ; Sets a 2 byte RAM pointer to an absolute address.
129 10000 ???? ;
130 10000 ???? ; Usage: SET_POINTER pointer, address
131 10000 ???? ; Example: SET_POINTER SpritePTR, SpriteData
132 10000 ???? ;
133 10000 ???? ; Note: Alters the accumulator, NZ flags
134 10000 ???? ; IN 1: 2 byte RAM location reserved for pointer
135 10000 ???? ; IN 2: absolute address
136 10000 ????
137 10000 ???? MAC set_pointer
138 10000 ???? .POINTER SET {1}
139 10000 ???? .ADDRESS SET {2}
140 10000 ????
141 10000 ???? LDA #<.ADDRESS ; Get Lowbyte of Address
142 10000 ???? STA .POINTER ; Store in pointer
143 10000 ???? LDA #>.ADDRESS ; Get Hibyte of Address
144 10000 ???? STA .POINTER+1 ; Store in pointer+1
145 10000 ????
146 10000 ???? ENDM
147 10000 ????
148 10000 ???? ; EOF
------- FILE 2600basic.h
------- FILE 2600basic_variable_redefs.h LEVEL 3 PASS 2
0 10000 ???? include "2600basic_variable_redefs.h"
1 10000 ???? ; This file contains variable mapping and other information for the current project.
2 10000 ????
------- FILE 2600basic.h
7 10000 ????
8 10000 ???? 00 80 player0x = $80
9 10000 ???? 00 81 player1x = $81
10 10000 ???? 00 82 missile0x = $82
11 10000 ???? 00 83 missile1x = $83
12 10000 ???? 00 84 ballx = $84
13 10000 ????
14 10000 ???? 00 85 objecty = $85
15 10000 ???? 00 85 player0y = $85
16 10000 ???? 00 86 player1y = $86
17 10000 ???? 00 87 missile1height = $87
18 10000 ???? 00 88 missile1y = $88
19 10000 ???? 00 89 bally = $89
20 10000 ????
21 10000 ???? 00 87 player1color = $87 ; replaces missile 1
22 10000 ????
23 10000 ???? 00 8a player0pointer = $8A ;uses $8A-$8B
24 10000 ???? 00 8a player0pointerlo = $8A
25 10000 ???? 00 8b player0pointerhi = $8B
26 10000 ???? 00 8c player1pointer = $8C ; $8C-$8D
27 10000 ???? 00 8c player1pointerlo = $8C
28 10000 ???? 00 8d player1pointerhi = $8D
29 10000 ????
30 10000 ???? 00 8e player0height = $8E
31 10000 ???? 00 8f player1height = $8F
32 10000 ???? 00 90 missile0height = $90
33 10000 ???? 00 91 missile0y = $91
34 10000 ???? 00 92 ballheight = $92
35 10000 ????
36 10000 ???? 00 90 currentpaddle = $90 ; replaces missile 0 (and can't be used with playercolor)
37 10000 ???? 00 91 paddle = $91 ; replaces missile 0
38 10000 ???? 00 82 player0colorstore = $82 ; replaces missile 0
39 10000 ???? 00 90 player0color = $90 ; replaces missile 0
40 10000 ????
41 10000 ???? 00 93 score = $93 ; $93-$95
42 10000 ???? 00 96 scorepointers = $96 ; $96-$9B = 6 bytes
43 10000 ???? 00 9c temp1 = $9C ;used by kernel. can be used in program too, but
44 10000 ???? 00 9d temp2 = $9D ;are obliterated when drawscreen is called.
45 10000 ???? 00 9e temp3 = $9E
46 10000 ???? 00 9f temp4 = $9F
47 10000 ???? 00 a0 temp5 = $A0
48 10000 ???? 00 a1 temp6 = $A1
49 10000 ????
50 10000 ???? 00 a2 rand = $A2
51 10000 ???? 00 a3 scorecolor = $A3
52 10000 ????
53 10000 ???? 00 a4 var0 = $A4
54 10000 ???? 00 a5 var1 = $A5
55 10000 ???? 00 a6 var2 = $A6
56 10000 ???? 00 a7 var3 = $A7
57 10000 ???? 00 a8 var4 = $A8
58 10000 ???? 00 a9 var5 = $A9
59 10000 ???? 00 aa var6 = $AA
60 10000 ???? 00 ab var7 = $AB
61 10000 ???? 00 ac var8 = $AC
62 10000 ???? 00 ad var9 = $AD
63 10000 ???? 00 ae var10 = $AE
64 10000 ???? 00 af var11 = $AF
65 10000 ???? 00 b0 var12 = $B0
66 10000 ???? 00 b1 var13 = $B1
67 10000 ???? 00 b2 var14 = $B2
68 10000 ???? 00 b3 var15 = $B3
69 10000 ???? 00 b4 var16 = $B4
70 10000 ???? 00 b5 var17 = $B5
71 10000 ???? 00 b6 var18 = $B6
72 10000 ???? 00 b7 var19 = $B7
73 10000 ???? 00 b8 var20 = $B8
74 10000 ???? 00 b9 var21 = $B9
75 10000 ???? 00 ba var22 = $BA
76 10000 ???? 00 bb var23 = $BB
77 10000 ???? 00 bc var24 = $BC
78 10000 ???? 00 bd var25 = $BD
79 10000 ???? 00 be var26 = $BE
80 10000 ???? 00 bf var27 = $BF
81 10000 ???? 00 c0 var28 = $C0
82 10000 ???? 00 c1 var29 = $C1
83 10000 ???? 00 c2 var30 = $C2
84 10000 ???? 00 c3 var31 = $C3
85 10000 ???? 00 c4 var32 = $C4
86 10000 ???? 00 c5 var33 = $C5
87 10000 ???? 00 c6 var34 = $C6
88 10000 ???? 00 c7 var35 = $C7
89 10000 ???? 00 c8 var36 = $C8
90 10000 ???? 00 c9 var37 = $C9
91 10000 ???? 00 ca var38 = $CA
92 10000 ???? 00 cb var39 = $CB
93 10000 ???? 00 cc var40 = $CC
94 10000 ???? 00 cd var41 = $CD
95 10000 ???? 00 ce var42 = $CE
96 10000 ???? 00 cf var43 = $CF
97 10000 ???? 00 d0 var44 = $D0
98 10000 ???? 00 d1 var45 = $D1
99 10000 ???? 00 d2 var46 = $D2
100 10000 ???? 00 d3 var47 = $D3
101 10000 ????
102 10000 ???? 00 d4 A = $d4
103 10000 ???? 00 d4 a = $d4
104 10000 ???? 00 d5 B = $d5
105 10000 ???? 00 d5 b = $d5
106 10000 ???? 00 d6 C = $d6
107 10000 ???? 00 d6 c = $d6
108 10000 ???? 00 d7 D = $d7
109 10000 ???? 00 d7 d = $d7
110 10000 ???? 00 d8 E = $d8
111 10000 ???? 00 d8 e = $d8
112 10000 ???? 00 d9 F = $d9
113 10000 ???? 00 d9 f = $d9
114 10000 ???? 00 da G = $da
115 10000 ???? 00 da g = $da
116 10000 ???? 00 db H = $db
117 10000 ???? 00 db h = $db
118 10000 ???? 00 dc I = $dc
119 10000 ???? 00 dc i = $dc
120 10000 ???? 00 dd J = $dd
121 10000 ???? 00 dd j = $dd
122 10000 ???? 00 de K = $de
123 10000 ???? 00 de k = $de
124 10000 ???? 00 df L = $df
125 10000 ???? 00 df l = $df
126 10000 ???? 00 e0 M = $e0
127 10000 ???? 00 e0 m = $e0
128 10000 ???? 00 e1 N = $e1
129 10000 ???? 00 e1 n = $e1
130 10000 ???? 00 e2 O = $e2
131 10000 ???? 00 e2 o = $e2
132 10000 ???? 00 e3 P = $e3
133 10000 ???? 00 e3 p = $e3
134 10000 ???? 00 e4 Q = $e4
135 10000 ???? 00 e4 q = $e4
136 10000 ???? 00 e5 R = $e5
137 10000 ???? 00 e5 r = $e5
138 10000 ???? 00 e6 S = $e6
139 10000 ???? 00 e6 s = $e6
140 10000 ???? 00 e7 T = $e7
141 10000 ???? 00 e7 t = $e7
142 10000 ???? 00 e8 U = $e8
143 10000 ???? 00 e8 u = $e8
144 10000 ???? 00 e9 V = $e9
145 10000 ???? 00 e9 v = $e9
146 10000 ???? 00 ea W = $ea
147 10000 ???? 00 ea w = $ea
148 10000 ???? 00 eb X = $eb
149 10000 ???? 00 eb x = $eb
150 10000 ???? 00 ec Y = $ec
151 10000 ???? 00 ec y = $ec
152 10000 ???? 00 ed Z = $ed
153 10000 ???? 00 ed z = $ed
154 10000 ????
155 10000 ???? 00 ee temp7 = $ee ; This is used to aid in bankswitching
156 10000 ???? 00 ef playfieldpos = $ef
157 10000 ????
158 10000 ???? ; available for other uses, or if unused, provide more stack space
159 10000 ????
160 10000 ???? 00 f0 aux1 = $f0
161 10000 ???? 00 f1 aux2 = $f1
162 10000 ???? 00 f2 aux3 = $f2
163 10000 ???? 00 f3 aux4 = $f3
164 10000 ???? 00 f4 aux5 = $f4
165 10000 ???? 00 f5 aux6 = $f5
166 10000 ????
167 10000 ???? ; playfield color/height pointers
168 10000 ???? 00 f0 pfcolortable = $f0 ; and $d5
169 10000 ???? 00 f0 pfheighttable = $f0 ; and $d5
170 10000 ???? ; the above pointers are the same because if color and height are both used together,
171 10000 ???? ; they must used absolute indexed and cannot use pointers
172 10000 ????
173 10000 ???? 00 f2 lifepointer = $f2 ; pointer to "lives" shape
174 10000 ???? ; upper 3 bits of $f2 contain the number of lives
175 10000 ???? 00 f4 lifecolor = $f4
176 10000 ???? 00 f3 lives = $f3 ; # lives >> 5
177 10000 ???? 00 f5 statusbarlength = $f5 ; only uses upper 5 bits; other bits free
178 10000 ????
179 10000 ???? 00 f2 pfscore1 = $f2 ; optional playfield bytes in score
180 10000 ???? 00 f3 pfscore2 = $f3
181 10000 ???? 00 f4 pfscorecolor = $f4
182 10000 ????
183 10000 ???? 00 f6 stack1 = $f6
184 10000 ???? 00 f7 stack2 = $f7
185 10000 ???? 00 f8 stack3 = $f8
186 10000 ???? 00 f9 stack4 = $f9
187 10000 ???? ; the stack bytes above may be used in the kernel
188 10000 ???? ; stack = F6-F7, F8-F9, FA-FB, FC-FD, FE-FF
189 10000 ????
190 10000 ???? MAC return
191 10000 ???? ifnconst bankswitch
192 10000 ???? rts
193 10000 ???? else
194 10000 ???? jmp BS_return
195 10000 ???? endif
196 10000 ???? ENDM ; auto-return from either a regular or bankswitched module
197 10000 ????
198 10000 ???? - ifconst superchip
199 10000 ???? -playfieldbase = $10D0
200 10000 ???? - include superchip.h
201 10000 ???? else
202 10000 ???? 00 a4 playfieldbase = $A4
203 10000 ???? endif
204 10000 ????
205 10000 ???? ifnconst pfhalfwidth
206 10000 ???? 00 04 pfwidth = 4
207 10000 ???? 00 0e PF1L = PF1
208 10000 ???? 00 0f PF2L = PF2
209 10000 ???? 00 0e PF1R = PF1
210 10000 ???? 00 0f PF2R = PF2
211 10000 ???? 00 00 pfadjust = 0
212 10000 ???? - else
213 10000 ???? -pfwidth = 2
214 10000 ???? - ifconst pfcenter
215 10000 ???? -PF1L = $3F ; no effect
216 10000 ???? -PF2L = PF2
217 10000 ???? -PF1R = $3F
218 10000 ???? -PF2R = PF2 ; no effect
219 10000 ???? -pfadjust = 1
220 10000 ???? - else
221 10000 ???? -PF1L = PF1
222 10000 ???? -PF2L = PF2
223 10000 ???? -PF1R = $3F ; no effect
224 10000 ???? -PF2R = $3F ; no effect
225 10000 ???? -pfadjust = 0
226 10000 ???? - endif
227 10000 ???? endif
228 10000 ????
229 10000 ???? ; define playfield start based on height
230 10000 ???? ifnconst pfres
231 10000 ???? 00 a4 playfield = playfieldbase
232 10000 ???? - else
233 10000 ???? -playfield = playfieldbase-(pfres-12*(4/pfwidth))*pfwidth
234 10000 ???? endif
------- FILE C:\Atari2600Dev\my_projects\Invader_Atari_2600_Basic\10b_MoveAnAnimatedSprite.bas.asm
------- FILE 2600basic_variable_redefs.h LEVEL 2 PASS 2
0 10000 ???? include "2600basic_variable_redefs.h"
1 10000 ???? ; This file contains variable mapping and other information for the current project.
2 10000 ????
------- FILE C:\Atari2600Dev\my_projects\Invader_Atari_2600_Basic\10b_MoveAnAnimatedSprite.bas.asm
8 10000 ???? - ifconst bankswitch
9 10000 ???? - if bankswitch == 8
10 10000 ???? - ORG $1000
11 10000 ???? - RORG $D000
12 10000 ???? - endif
13 10000 ???? - if bankswitch == 16
14 10000 ???? - ORG $1000
15 10000 ???? - RORG $9000
16 10000 ???? - endif
17 10000 ???? - if bankswitch == 32
18 10000 ???? - ORG $1000
19 10000 ???? - RORG $1000
20 10000 ???? - endif
21 10000 ???? - if bankswitch == 64
22 10000 ???? - ORG $1000
23 10000 ???? - RORG $1000
24 10000 ???? - endif
25 10000 ???? else
26 f000 ORG $F000
27 f000 endif
28 f000
29 f000 - ifconst bankswitch_hotspot
30 f000 - if bankswitch_hotspot = $083F ; 0840 bankswitching hotspot
31 f000 - .byte 0 ; stop unexpected bankswitches
32 f000 - endif
33 f000 endif
34 f000 ; Provided under the CC0 license. See the included LICENSE.txt for details.
35 f000
36 f000 start
37 f000 78 sei
38 f001 d8 cld
39 f002 a0 00 ldy #0
40 f004 a5 d0 lda $D0
41 f006 c9 2c cmp #$2C ;check RAM location #1
42 f008 d0 07 bne MachineIs2600
43 f00a a5 d1 lda $D1
44 f00c c9 a9 cmp #$A9 ;check RAM location #2
45 f00e d0 01 bne MachineIs2600
46 f010 88 dey
47 f011 MachineIs2600