-
Notifications
You must be signed in to change notification settings - Fork 0
/
Shoot.asm
1705 lines (1525 loc) · 51.7 KB
/
Shoot.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;-*-MIDAS-*-
.ENABLE LC
.NLIST SEQ
.TITLE SHOOT
.SBTTL by John H. Palevich
;
;
; "Shoot" -- inspired by the Atari VCS "Air Sea Battle" cartridge.
;
; Feel free to modify & give away. Don't even think of selling this.
; O.K. If you want to assemble this on your Atari, you'll have to
; change some things around. Most changes can be inferred from looking
; at the code that this assembler produced and figuring out what you'd
; have to type to get the Atari to do the same thing.
;
; Some hints, though:
; ^ means /256
; .= means *=
; .ASCII means .BYTE
; (in expressions) means the value of the program counter
;
; Lables shouldn't have ':'s.
;
; Colleen Operating System Equate File
;
CHRORG = $E000 ;CHARACTER SET
VECTBL = $E400 ;VECTOR TABLE
VCTABL = $E480 ;RAM VECTOR INITIAL VALUE TABLE
CIOORG = $E4A6 ;CENTRAL I/O HANDLER
INTORG = $EC05 ;INTERRUPT HANDLER
SIOORG = $E344 ;SERIAL I/O HANDLER
DSKORG = $E0FA ;DISK HANDLER
PRNORG = $EE7B ;PRINTER HANDLER
CASORG = $EF41 ;CASSETTE HANDLER
MONORG = $F0E3 ;MONITOR/POWER UP MODULE
KBDORG = $F3E4 ;KEYBOARD/DISPLAY HANDLER
;
;
;
;
; VECTOR TABLE
;
; HANLDER ENTRY POINTS ARE CALLED OUT IS THE FOLLOWING VECTOR
; TABLE. THESE ARE THE ADDRESSES MINUS ONE.
;
; Example for Editor
;
; E400 Open
; 2 Close
; 4 Get
; 8 Put
; B Status
; A Special
; C Jump to Power on initialization routine
;
;
;
EDITRV = $E400 ;EDITOR
SCRENV = $E410 ;TELEVISION SCREEN
KEYBDV = $F420 ;KEYBOARD
PRINTV = $E430 ;PRINTER
CASETV = $E440 ;CASSETTE
;
; JUMP VECTOR TABLE
;
;THE FOLLOWING IS A TABLE OF JUMP INSTRUCTIONS
;TO VARIOUS ENTRY POINTS IN THE OPERATING SYSTEM
;
DISKIV = $E450 ;disk initialization
DSKINV = $E453 ;disk interface
CIOV = $E456 ;central input output routine
ICZERO = $0 ;proper values for X
ICONE = $10 ;when calling CIOV for each
ICTWO = $20 ;of the IO control Blocks
ICTHRE = $30
ICFOUR = $40
ICFIVE = $50
ICSIX = $60
ICSEVE = $70
SIOV = $E459 ;serial input output routine
SETVBV = $E45C ;set system timers routine
; With respect to SETVBV. the call sequence is
; X = MSB of vector/timer
; Y = LSB of vector/timer
; A = # of vector to hack
SETMR1 = 1 ;Timer 1
SETMR2 = 2 ; 2
SETMR3 = 3 ; 3
SETMR4 = 4 ; 4
SETMR5 = 5 ; 5
SETIMM = 6 ;Immediate VBLANK
SETDEF = 7 ;Deffered VBLANK
SYSVBV = $E45F ;SYSTEM VERTICAL BLANK CALCULATIONS
XITVBL = $E462 ;EXIT VERTICAL BLANK CALCULATIONS
SIOINV = $E465 ;SERIAL INPUT OUTPUT INITIALIZATION
SENDEV = $E468 ;SEND ENABLE ROUTINE
INTINV = $E46B ;INTERRUPT HANDLER INITIALIZATION
CIOINV = $E46E ;CENTRAL INPUT OUTPUT INITIALIZATION
BLKBDV = $E471 ;BLACKBOARD MODE
VARMSV = $E474 ;WARM START ENTRY POINT
COLDSV = $E477 ;COLD START ENTRY POINT
RBLOKV = $E47A ;CASSETTE READ BLOCK ENTRY POINT VECTOR
CSOPIV = $E470 ;CASSETTE OPEN TOR INPUT VECTOR
;VCTABL = $E480
;
;
; OPERATING SYSTEM EQUATES
;
; COMMAND CODES FOR IOCBS
OPEN = 3 ;OPEN FOR INPUT/OUTPUT
GETREC = 5 ;GET RECORD (TEXT)
GETCHR = 7 ;GET CHARACTER(S)
PUTREC = 9 ;PUT RECORD (TEXT)
PUTCHR = $B ;PUT CHARACTER(S)
CLOSE = $C ;CLOSE DEVICE
STATIS = $D ;STATUS REQUEST
SPECIL = $E ;BEGINNING OF SPECIAL ENTRY COMMANDS
;
; SPECIAL ENTRY COMMANDS
DRAWLN = $11 ;DRAW LINE
FILLIN = $12 ;DRAW LINE WITH RIGHT FILL
RENAME = $20 ;RENAME DISK FILE
DELETE = $21 ;DELETE DISK FILE
FORMAT = $22 ;FORMAT
LOCKFL = $23 ;LOCK FILE TO READ ONLY
UNLOCK = $24 ;UNLOCK LOCKED FILE
POINT = $25 ;POINT SECTOR
NOTE = $26 ;NOTE SECTOR
IOCFRE = $FF ;IOCB "FREE"
;
; AUX1 EQUATES
; () INDICATES WHICH DEVICES USE BIT
APPEND = $1 ;OPEN FOR WRITE APPEND (D). OR SCREEN READ (E)
DIRECT = $2 ;OPEN FOR DIRECTORY ACCESS (D)
OPNIN = $4 ;OPEN FOR INPUT (ALL DEVICES)
OPNOT = $8 ;GPEN FOR OUTPUT (ALL DEVICES)
OPNINO = OPNIN+OPNOT ;OPEN FOR INPUT AND OUTPUT (ALL DEVICES)
MXDMOD = $10 ;OPEN FOR MIXED MODE (E,S)
INSCLR = $20 ;OPEN WITHOUT CLEARING SCREEN (E,S)
;
; DEVICE NAMES
;
SCREDT = 'E ;SCREEN EDITOR (R/W)
KBD = 'K ;KEYBOARD (R ONLY)
DISPLY = 'S ;SCREEN DISPIAY (R/W)
PRINTR = 'P ;PRINTER (W ONLY)
CASSET = 'C ;CASSETTE
MODEM = 'M ;MODEM
DISK = 'D ;DISK
;
;
;
;
; OPERATING SYSTEM STATUS CODES
;
SUCCES = $01 ;SUCCESSFUL OPERATION
;
BRKABT = $80 ;BREAK KEY ABORT
PRVOPN = $81 ;IOCB ALREADY OPEN
NONDEV = $82 ;NON-EXISTANT DEVICE
VRONLY = $83 ;IOCB OPENED FOR WRITE ONLY
NVALID = $84 ;INVALID COMMAND
NOIOPN = $85 ;DEVICE OR FILE NOT OPEN
BADIOC = $86 ;INVALID IOCB NUMBER
RDONLY = $87 ;IOCB OPENED FOR READ ONLY
EOFERR = $88 ;END OF FILE
TRNRCD = $89 ;TRUNCATED RECORD
TIMOUT = $8A ;PERIPHERAL TIME OUT
DNACK = $8B ;DEVICE DOES NOT ACKNOWLEDGE COMMAND
FRMERR = $8C ;SERIAL BUS FRAMING ERROR
CRSROR = $8D ;CURSOR OVERRANGE
OVRRUN = $8E ;SERIAL BUS DATA OVERRUN
CHKERR = $8F ;SERIAL BUS CHECKSUM ERROR
;
DERRER = $90 ;PERIPHERAL DEVICE ERROR (OPERATION NOT COMPLETED)
BADMOD = $91 ;BAD SCREEN MODE NUMBER
FNCNOT = $92 ;FUNCTION NOT IMPLEMENTED IN HANDLER
SCRMEM = $93 ;INSUFICIENT MEMORY FOR SCREEN MODE
;
;
;
;
;
; PAGE ZERO RAM ASSIGNMENTS
;
LINZBS = $0000 ;LINBUG RAM (WILL BE REPLACED BY MONITOR RAM)
;
; THESE LOCATIONS ARE NOT CLEARED
CASINI = $0002 ;CASSETTE INIT LOCATION
RAMLO = $0004 ;RAM POINTER FOR MEMORY TEST
TRAMSZ = $0006 ;TEMPORARY REGISTER FOR RAM SIZE
TSTDAT = $0007 ;RAM TEST DATA REGISTER
;
; CLEARED ON COLD START ONLY
WARMST = $0008 ;WARM START FLAG
BOOTQ = $0009 ;SUCCESSFUL BOOT FLAG <WAS BOOT?>
DOSVEC = $000A ;DISK SOFTWARE START FLAG
DOSINI = $000C ;DISK SOFTWARE INIT ADDRESS
APPMHI = $000E ;APPLICATIONS MEMORY HI LIMIT
;
; CLEARED ON A COLD OR WARM START
INTZBS = $0010 ;INTERRUPT HANDLER
POKMSK = $0010 ;SYSTEM MASK FOR POKEY IRQ HANDLER
BRKKEY = $0011 ;BREAK KEY FLAG
RTCLOCK = $0012 ;REAL TIME CLOCK (IN 16 MSEC UNITS)
;
BUFADR = $0015 ;INDIRECT BUFFER ADDRESS REGISTER
;
ICCOMT = $0017 ;COMMAND FOR VECTOR
;
DSKFMS = $0018 ;DISK FILE MANAGER POINTER
;
DSKUTL = $001A ;DISK UTILITIES POINTER
;
PTIMOT = $001C ;PRINTER TIME OUT REGISTER
PBPNT = $001D ;PRINTER BUFFER POINTER
PBUFSZ = $001E ;PRINT BUFFER SIZE
PTEMP = $001F ;TEMPORARY REGISTER
;
ZIOCB = $0020 ;ZERO PAGE I/O CONIROL BLOCK
IOCBSZ = 16 ;NUMBER OF BYTES PER IOCB
MAXIOC = 8*IOCBSZ ;LENGTH OF THE IOCB AREA
IOCBAS = $0020
ICHIDZ = $0020 ;HANDLER INDEX NUMBER (FF == IOCB FREE)
ICDNOZ = $0021 ;DEVICE NUMBER (DRIVE NUMBER)
ICCOMZ = $0022 ;COMMAND CODE
ICSTAZ = $0023 ;STATUS OF LAST IOCB ACTION
ICBALZ = $0024 ;BUFFER ADDRESS LOW BYTE
ICBAHZ = $0025 ;BUFFER ADDRESS HIGH BYTE
ICPTLZ = $0026 ;PUT BYTE ROUTINE ADDRESS - 1
ICPTHZ = $0027 ;
ICBLLZ = $0028 ;BUFFER LENGTH LOW BYTE
ICBLHZ = $0029
ICAX1Z = $002A ;AUXILIARY INFORMATION FIRST BYTE
ICAX2Z = $002B
ICSPRZ = $002C ;TWO SPARE BYTES (CIO LOCAL USE)
ICIDNO = ICSPRZ+2 ;IOCB NUMBER X 16
CIOCHR = ICSPRZ+3 ;CHARACTER BYTE FOR CURRENT OPERATION
;
STATUS = $0030 ;INTERNAL STATUS STORAGE
CHKSUM = $0031 ;CHECKSUM (SINGLE BYTE SUM WITH CARRY)
BUFRLO = $0032 ;POINTER TO DATA BUFFER (LO BYTE)
BUFRHI = $0033 ;POINTER TO DATA BUFFER (HI BYTE)
BFENLO = $0034 ;NEXT BYTE PAST END OF DATA BUFFER (LO BYTE)
BFENHI = $0035 ;NEXT BYTE PAST EHD OF DATA BUFFER (HI BYIE)
CRETRY = $0036 ;NUMBER OF COMMAND FRAME RETRIES
ORETRY = $0037 ;NUMBER OF DEVICE RETRIES
BUFRFL = $0038 ;DATA BUFFER FULL FLAG
RECVDN = $0039 ;RECIEVE DONE FLAG
XMTDON = $003A ;TRANSMISSION DONE FLAG
CHKSNT = $003B ;CHECKSUM SENT FLAG
NOCKSM = $003C ;NO CHECKSUM FOLLOWS DATA FLAG
;
;
BPTR = $003D
FTYPE = $003E
FEOF = $003F
FREQ = $0040
SOUNDR = $0041 ;NOISY I/O FLAG (ZERO IS QUIET)
CRITIC = $0042 ;DEFINES CRITICAL SECTION (CRITICAL IF NON-ZERO)
;
FMSZPG = $0043 ;TOTAL OF 7 BYTES FOR DISK FILE MANAGER ZERO PAGE
;
;
CKEY = $004A ;FLAG SET WHEN GAME START PRESSED
CASSBT = $0048 ;CASSETTE BOOT FLAG
DSTAT = $004C ;DISPLAY STATUS
;
ATRACT = $004D ;ATRACT FLAG
DRKMSK = $004E ;DARK ATRACT FLAG
COLRSH = $004F ;ATRACT COLOR SHIFTER (EOR'D WITH PLAYFIELD COLORS)
;
;LEDGE = 2 ;LMARGN'S VALUE AT COLD START
;REDGE = 39 ;
TMPCHR = $0050
HOLD1 = $0051
LMARGN = $0052 ;LEFT MARGIN (SET TO ONE AT POWER ON)
RMARGN = $0053 ;RIGHT MARGIN (SET TO ONE AT POWER ON)
ROWCRS = $0054 ;CURSOR COUNTERS
COLCRS = $0055
DINDEX = $0057
SAVMSC = $0056
OLDROW = $005A
OLDCOL = $005B
OLDCHR = $005D ;DATA UNDER CURSOR
OLDADR = $005E
NEWROW = $0060 ;POINT DRAW GOES TO
NEWCOL = $0061
LOGCOL = $0063 ;POINTS AT COLUMN IN LOGICAL LINE
AORESS = $0064
MLTTMP = $0066
SAVADR = $0068
RAMTOP = $006A ;RAM SIZE DEFINED BY POWER ON LOGIC
BUFCNT = $006B ;BUFFER COUNT
BUFSTR = $006C ;EDITOR GETCH POINTER
BITMSK = $006E ;BIT MASK
; LOTS OF RANDOM TEMPS
SWPFLG = $007B ;NON-0 IF TXT AND REGULAR RAM IS SWAPPED
HOLDCH = $007C ;CH IS MOVED HERE IF KGETCH BEfore CNTL & SHIFT PROC
;
;
;
; 80 - FF ARE FOR FP, USER, FMS AND DOS
;
;
; PAGE 1 -- STACK
;
;
; PAGE TWO RAM ASSIGNMENTS
;
INTABS = $0200 ;INTERRUPT RAM
VDBLST = $0200 ;DISPLAY LIST NMI VECTOR
VPRCED = $0202 ;PROCEED LINE IRQ VECTOR
VINTER = $0204 ;INTERRUPT LINE IRQ VECTOR
VBREAK = $0206 ;SOFTWARE BREAK (00) INSTRUCTION IRQ VECTOR
VKEYBD = $0208 ;POKEY KEYBOARD IRQ VECTOR
VSERIN = $020A ;POKEY SERIAL INPUT READY IRQ
VSEROR = $020C ;POKEY SERIAL OUTPUT READY IRQ
VSEROC = $020E ;POKEY SERIAL OUTPUT COMPLETE IRQ
VTIMR1 = $0210 ;POKEY TIMER 1 IRQ
VTIMR2 = $0212 ;POKEY TIMER 2 IRQ
VTIMR4 = $0214 ;POKEY TIMER 4 IRQ
VIMIRQ = $0216 ;IMMEDIATE IRQ VECTOR
CDTMV1 = $0218 ;COUNT DOWN TIMER 1
CDTMV2 = $021A ;COUNT DOWN TIMER 2
CDTMV3 = $021C ;COUNT DOWN TIMER 3
CDTMV4 = $021E ;COUNT DOWN TIMER 4
CDTMV6 = $0220 ;COUNT DOWN TIMER 5
VVBLKI = $0222 ;IMMEDIATE VERTICAL BLANK NMI VECTOR
VVBLKD = $0224 ;DEFERRED VERTICAL BLANK NMI VECTOR
CDTMA1 = $0226 ;COUNT DOWN TIMER 1 JSR ADDRESS
CDTMA2 = $0228 ;COUNT DOWN TIMER 2 JSR ADDRESS
CDTMF3 = $022A ;COUNT DOWN TIMER 3 FLAG
SRTIMR = $022B ;SOFTWARE REPEAT TIMER
CDTMF4 = $022C ;COUNT DOWN TIMER 4 FLAG
CDTMF5 = $022E ;COUNT DOWN TIMER 5 FLAG
SDMCTL = $022F ;SAVE DMACTL REGISTER
SDLSTL = $0230 ;SAVE DISPLAY LIST LOW BYTE
SDLSTH = $0231 ;SAVE DISPLAY LIST HIGH BYTE
SSKCTL = $0232 ;SKCTL REGISTER RAM
;
LPENH = $0234 ;LIGHT PEN HORIZONTAL VALUE
LPENV = $0235 ;LIGHT PEN VERTICAL VALUE
GPRIOR = $26F ;Global priority call
;
;
; POTENTIOMETERS
;
;
PADDL0 = $0270
PADDL1 = $0271
PADDL2 = $0272
PADDL3 = $0273
PADDL4 = $0274
PADDL5 = $0275
PADDL6 = $0276
PADDL7 = $0277
;
;
; JOYSTICKS
;
;
STICK0 = $0278
STICK1 = $0279
STICK2 = $027A
STICK3 = $027B
;
;
; PADDLE TRIGGER
;
;
PTRIG0 = $027C
PTRIG1 = $027D
PTR1G2 = $027E
PTRIG3 = $027F
PTRIG4 = $0280
PTRIG5 = $0281
PTRIG6 = $0282
PTRIG7 = $0283
;
;
; JOYSTICK TRIGGER
;
;
STRIG0 = $0284
STRIG1 = $0285
STRIG2 = $0286
STRIG3 = $0287
;
; Many random OS variables, the following were commented
;
TXTROW = $0290 ;Text rowcrs
TXTCOL = $0291 ;Text colcrs
TINDEX = $0293 ;text index
TXTMSC = $0294 ;fools convert into new msc
TXTOLD = $0296 ;oldrow and oldcol for text (etc.)
ESCFLG = $02A2 ;Escape flag
LOGMAP = $02B2 ;Logical line start bit map
INVFLAG = $02B6 ;Inverse video flag (toggled by Atari key)
FILFLG = $02B7 ;Fill flag for draw
SCRFLG = $02B8 ;Set if scroll occures
SHFLOK = $02BE ;Shift lock
BOTSCR = $02BF ;Bottom of screen: 24 Norm. 4 Split.
;
;
; COLORS
;
;
PCOLR0 = $02C0 ;P0 COLOR
PCOLR1 = $02C1 ;P1 COLOR
PCOLR2 = $02C2 ;P2 COLOR
PCOLR3 = $02C3 ;P3 COLOR
COLOR0 = $02C4 ;COLOR 0
COLOR1 = $02C5 ;COLOR 1
COLOR2 = $02C6 ;COLOR 2
COLOR3 = $02C7 ;COLOR 3
COLOR4 = $02C8 ;COLOR 4
;
;
; GLOBAL VARIABLES
;
;
RAMSIZ = $02E4 ;RAM SIZE (HI BYTE ONLY)
MEMIOP = $0215 ;TOP OF AVAILABLE USER MEMORY
MEMLO = $02E7 ;BOTTOM OF AVAILABLE USER MEMORY
DVSTAT = $02EA ;STATUS BUFFER
;
CRSINH = $02F0 ;CURSOR INHIBIT (00 = CURSOR ON)
KEYDEL = $02F1 ;Key delay
CHACT = $02F3 ;CHACTL REGISTER RAM
CHBAS = $02F4 ;CHBAS REGISTER RAM
FILDAT = $02FD ;RIGHT FILL DATA (DRAW)
ATACHR = $02FB ;Atascii character
CM = $02FC ;global variable for keyboard
DSPFLA = $02FE ;DISPLAY FLAG: DISPLAYS CNTLS IF NON ZERO:
SSFLAG = $02FF ;Start/stop flag for paging (CNTL 1). Cleared by Break
;
; Page three RAM assignments
;
; Device control blocks
; (SIO)
DCB = $0300 ;Device control block
DDEVIC = $0300 ;Peripheral Unit 1 bus I.D. number
DUNIT = $0301 ;Unit number
DCOMND = $0302 ;Bus command
DSFATS = $0303 ;Command Type/status return
DBUFLO = $0304 ;Data buff- points low
DBUFHI = $0305
DTIMLO = $0306 ;Device time out in 1 second units
DBYTLO = $0308 ;Number of bytes to be transvered low byte
DBYTHI = $0309
DAUX1 = $030A ;Command Aux byte 1
DAUX2 = $0308
;
IOCB = $0340
ICHID = $0340 ;Handler index number (FF = IOCB free)
ICDNO = $0341 ;Device number (drive number)
ICCOM = $0342 ;Command code
ICSTA = $0343 ;Status of last IOCB action
ICBAL = $0344 ;Buffer address low byte
ICBAH = $0345
ICPTL = $0346 ;Put byte routine address - 1
ICPTH = $0347
ICBLL = $0348 ;Buffer length low byte
ICBLH = $0349
ICAX1 = $034A ;Auxiliary information first byte
ICAX2 = $034B
ICSPR = $034C ;four spare bytes
;
PRNBUF = $0300 ;Printer buffer (40 bytes)
; (21 spare bytes)
;
; Page Four Ram Assignnents
CASBUF = $03FD ;Cassette Buffer (131 bytes)
;
USAREA = $0480 ; (0480 thru 05FF for the user)
; (except for floating point...)
;
; FLOATING POINT ROM ROUTINES
;
;
; IF CARRY IS USED THEN CARRY CLEAR => NO ERROR. CARRY SET => ERROR
;
AFP = $D800 ;ASCII -> FLOATING POINT (FP)
; INBUFF * CIX -> FR0, CIX, CARRY
FASC = $D8E6 ;FP -> ASCII FR0 -> F0R,FD0-1, CARRY
IFP = $D9AA ;INTEGER -> FP
; 0-$FFFF (LSB, MSB) IN FR0,FR0+1->FR0
FPI = $D92D ;FP -> INTEGER FR0 -> FR0,FR0+1, CARRY
FSUB = $DA60 ;FR0 <- FR0 - FR1, CARRY
FADD = $DA66 ;FR0 <- FR0 + FR1 ,CARRY
FMUL = $DADB ;FR0 <- FR0 * FR1 ,CARRY
FDIV = $DB28 ;FR0 <- FR0 / FR1 ,CARRY
FLD0R = $DD89 ;FLOATING LOAD REG0 FR0 <- (X,Y)
FLD0P = $DD8D ; FR0 <- (FLPTR)
FLD1R = $DD9B ; FR1 <- (X,Y)
FLD1P = $DD9C ; FR1 <- (FLPTR)
FST0R = $DDA7 ;FLOATING STORE REG0 (X,Y) <- FR0
FST0P = $DDAB ; (FLTPTR)<- FR0
FMOVE = $DDB6 ;FR1 <- FR0
PLYEVL = $DD40 ;FR0 <- P(Z) = SUM(I = N TO 0) (A(I) *Z**I) CARRY
; INPUT: (X,Y) = A(N), A(N-I)...A(0) -> PLYARG
; ACC = # OF COEFFICIENTS = DEGREE + 1
; FR0 = Z
EXP = $DDC0 ;FR0 <- E**FR0 = EXP10(FR0 * LOG10(E)) CARRY
EXP10 = $DDCC ;FR0 <- 10**FR0 CARRY
LOG = $DECD ;FR0 <- LN(FR0) = LOG10(FR0) / LOG10(E) CARRY
LOG10 = $DE01 ;FR0 <- LOG10(FR0) CARRY
;
;
; THE FOLLOWING ARE IN THE BASIC CARTRIDGE:
;
;
SIN = $BD81 ;FR0 <- SIN(FR0) DEGFLG=0 => RADS, 6->DEG. CARRY
COS = $BD73 ;FR0 <- COS(FR0) CARRY
ATAN = $BD43 ;FR0 <- ATN(FR0) CARRY
SQR = $BEB1 ;FR0 <- SQUAREROOT(FR0) CARRY
;
;
; FLOATING POINT ROUTINES ZERO PAGE (NEEDED ONLY IF F.P.
; ROUTINES ARE CALLED)
FR0 = $00D4 ;FP REG0
FR1 = $00E0 ;FP REG1
CIX = $00F2 ;CURRENT INPUT INDEX
INBUFF = $00F3 ;POINTS TO USER'S LINE INPUT BUFFER
RADFLG = $00FB ;0 = RADIANS, 6 = DEGREES
FLTPTR = $00FC ;POINTS TO USERS FLOATING POINT NUMBER
;
;
; FLOATING POINT ROUTINES' NON-ZP RAM
;
; (057E to 06FF)
;
LBUFF = $0580 ;LINE BUFFER
PLYARG = LBUFF+$60 ;POLYNOMILA ARGUMENTS
;
;
;
;
;
; COLLEEN MNEMONICS
;
;
;
POKEY = $D200 ;VBLANK ACTION: DESCRIPTION:
POT0 = POKEY+0 ;POT0-->PADDL0 0-227 IN RAM CELL
POT1 = POKEY+1 ;POT1-->PADDL1 0-227 IN RAM CELL
POT2 = POKEY+2 ;POT2-->PADDL2 0-227 IN RAM CELL
POT3 = POKEY+3 ;POT3-->PADDL3 0-227 IN RAM CELL
POT4 = POKEY+4 ;POT4-->PADDL4 0-227 IN RAM CELL
POTS = POKEY+5 ;POT5-->PADDL5 0-227 IN RAM CELL
POTC = POKEY+6 ;POT6-->PADDL8 0-227 IN RAM CELL
POT7 = POKEY+7 ;POT7-->PADDL7 0-227 IN RAM CELL
ALLPOT = POKEY+8 ;???
KBCODE = POKEY+9
RANDOM = POKEY+10
POTGO = POKEY+11 ;Strobed
; n/a
SERIN = POKEY+13
IRQST = POKEY+14
SKSTAT = POKEY+15
;
AUDF1 = POKEY+0
AUDC1 = POKEY+1
AUDF2 = POKEY+2
AUDC2 = POKEY+3
AUDF3 = POKEY+4
AUDC3 = POKEY+5
AUDF4 = POKEY+6
AUDC4 = POKEY+7
AUDCT = POKEY+8 ;NONE AUDCTL<--[SIO]
STIMER = POKEY+9
SKRES = POKEY+10 ;NONE SKRES<--[SIO]
;
POTGO = POKEY+11
SEROUT = POKEY+13 ;NONE SEROUT<--[SIO]
IRQEN = POKEY+14 ;POKMSK-->IRQEN (AFFECTED BY OPEN S: OR E:)
SKCTL = POKEY+16 ;SSKCTL-->SKCTL SSKCTL<--[SIO]
;
CTIA = $D000
HPOSP0 = CTIA+0
HPOSP1 = CTIA+1
HPOSP2 = CTIA+2
HPOSP3 = CTIA+3
HPOSM0 = CTIA+4
HPOSM1 = CTIA+5
HPOSM2 = CTIA+6
HPOSM3 = CTIA+7
SIZEP0 = CTIA+8
SIZEP1 = CTIA+9
SIZEP2 = CTIA+10
SIZCP3 = CTIA+11
SIZEM = CTIA+12
GRAFP0 = CTIA+13
GRAFP1 = CTIA+14
GRAFP2 = CTIA+15
GRAFP3 = CTIA+16
GRAFM = CTIA+17
COLPM0 = CTIA+18 ;PCOLR0-->COLPM0 WITH ATTRACT MODE
COLPM1 = CTIA+19 ;ETC.N
COLPM2 = CTIA+20
COLPM3 = CTIA+21
COLPF0 = CTIA+22
COLPF1 = CTIA+23
COLPF2 = CTIA+24
COLPF3 = CTIA+25
COLBK = CTIA+26
PRIOR = CTIA+27
VDELAY = CTIA+28
GRACTL = CTIA+29
HITCLR = CTIA+30
CONSOL = CTIA+31 ;$08-->CONSOL TURN OFF SPEAKER
;
M0PF = CTIA+0
M2PF = CTIA+2
M3PF = CTIA+3
P0PF = CTIA+4
P1PF = CTIA+5
P2PF = CTIA+6
P3PF = CTIA+7
M0PL = CTIA+8
M1PL = CTIA+9
M2PL = CTIA+10
M3PL = CTIA+11
P0PL = CTIA+12
P1PL = CTIA+13
P2PL = CTIA+14
P3PL = CTIA+15
TRIG0 = CTIA+16 ;TRIG0-->STRIG1
TRIG1 = CTIA+17 ;ETC.
TR1G2 = CTIA+18
TRIG3 = CTIA+19
PAL = CTIA+20
;
ANTIC = $D400
DMACTL = ANTIC+0 ;DMACTL<--SDMCTL ON OPEN S: OR E:
CHARCTL = ANTIC+1 ;CHACTL<--CHACT ON OPEN S: OR E:
DLISTL = ANTIC+2 ;DIISTt<--SDLSTL ON OPEN S: OR E:
DLISTH = ANTIC+3 ;OLISFH<--SDLSTH ON OPEN S: OR E:
HSCROL = ANTIC+4
VSCROL = ANTIC+5
PMBASE = ANTIC+7
CHBASE = ANTIC+9 ;CMBASE<--CHBAS ON OPEN S: OR E:
WSYNC = ANTIC+10
VCOUNT = ANTIC+11
PENH = ANTIC+12
PENV = ANTIC+13
NMIEN = ANTIC+14 ;NMIEN<--40 POWER ON AND [SETVBV]
NMIRES = ANTIC+15 ;STROBED
HMIST = ANTIC+15
;
; Lots and lots of unofficial
; Mnemonics for display list instructions.
; as well as other bit patterns.
;
; DL prefix implies display list
; instruction, naturally
;
DLBL1 = 0 ; One blank line
DLBL2 = $10 ; Two blank lines
DLBL3 = $20 ; Three
DLBL4 = $30 ; Four
DLBL5 = $40 ; Five
DLBL6 = $50 ; Six
DLBL7 = $60 ; Seven
DLBL8 = $70 ; Eight blank lines
DLINT = $80 ; Generate DisplayListInterrupt when this
; instruction is interpreted.
DLJMP = $1 ; Tells Antic Chip to junp to contents of next two bytes
DLJVB = $41 ; Same as DLJMP but also halts ANTIC 'till next verticle blank
DLLDM = $40 ; Tells Antic chip to start retrieving data from memory referenced by the next t
DLVSCR = $20 ; (sort of) enables vertical scroll
DLHSCR = $10 ; enable horizontal scroll
;
; Playfield Instructions
;
DLPF15 = 15 ; 320 dots 2 colors 1 scan line
DLPF14 = 14 ; 160 4 1
DLPF13 = 13 ; 160 4 2
DLPF12 = 12 ; 160 2 1
DLPF11 = 11 ; 160 2 2
DLPF10 = 10 ; 80 4 4
DLPF9 = 9 ; 80 2 4
DLPF8 = 8 ; 40 4 8
; Character PF types
DLPF7 = 7 ; 20 chars 5 colors 16 scan lines
DLPF6 = 6 ; 20 5 8
DLPF5 = 5 ; 40 5 16 (hairy 4 color characters)
DLPF4 = 4 ; 40 5 8
DLPF3 = 3 ; 40 2 10 (Text processing)
DLPF2 = 2 ; 40 2 8 (Normal text mode)
; PF1 & PF0 are special. . . .
;
; Player & Missile Offsets
; Denoted by PM prefix
;
PMLF = $24 ;left side of screen
PMRF = $DD ;flight side of screen
PMDM = $180 ;Missile offset, for double line resolution
PMDP0 = $200 ;Player 0
PMDP1 = $280 ;Player 1
PMDP2 = $300 ;Player 2
PMDP3 = $380 ;Player 3
PMSM = 2*PMDM ;Missile offset for single line resolution
PMSP0 = 2*PMDP0 ;Player 0
PMSP1 = 2*PMDP1 ; 1
PMSP2 = 2*PMDP2 ; 2
PMSP3 = 2*PMDP3 ; 3
;
; Colors. denoted by CL
;
CLGREY = 0 ;grey
CLGOLD = $10 ;gold
CLORNG = $20 ;orange
CLRED = $30 ;red-orange
CLPINK = $40 ;pink
CLPURP = $50 ;purple
CLPURB = $60 ;purple blue
CLPBLU = $70 ;blue 1
CLBLUE = $80 ;blue 2
CLLBLU = $90 ;light blue
CLTURQ = $A0 ;turquoise
CLGBLU = $B0 ;green blue
CLGREN = $C0 ;green
CLYGRN = $D0 ;yellow green
CLOGRN = $E0 ;orange green
CLLTOR = $F0 ;light orange
; Bit Masks for console switches
;
SWSTRT = $1 ;Start
SWSEL = $2 ;Select
SWOPT = $4 ;Option
; Joystick bit masks
JYR = 8 ;Right
JYL = 4 ;Left
JYB = 2 ;Back
JYF = 1 ;Forward
PIA = $D300
PORTA = PIA+0 ;PORTA-->STICK0,1 X-Y CONTROLLERS
PORTB = PIA+1 ;PORTB-->STICK2,3
PACTL = PIA+2 ;NONE PACTL<--3C [INIT]
PBCTL = PIA+3 ;NONE PBCTL<--3C [INIT]
ASCZER = '0 ;Ascii zero
COLON = $3A ;Ascii Colon
EOL = $9B ;End of Record
; The Following are subroutines
PUTLIN = $F385 ;X -- Lo byte
;Y -- Hi byte
;of line
XVB = $E7D1 ;System VBLANK exit routine
;
;
;
; End of Atari equates.
;
; The rest of this is (C)1981 John H. Palevich
;
;
ORG = $1000 ;Must be at least 3K of memory
;above this point. . . .
.=ORG
;Once in the actual game you can make
;identical copies of it by pressing OPTION
;and SELECT down simultaneously between
;plays. The Atari will beep twice and you
;should press play & record and then RETURN
;to make a copy. After one copy is made
;the game starts all over again.
PST=.
;
; This is the Boot tape header table.
;
.BYTE 0 ;Traditional
.BYTE PND-PST+127/128 ;# of 128 byte blocks in program
.ADDR PST ;Start of place to load program
.ADDR PINIT ;Place to jump after loading
;program
; ENTRY POINT FOR MULTI-STAGE BOOT PROCESS.
CLC
RTS
; ENTRY POINT FOR FIRST TIME INITIALIZATION
PINIT: LDA #$3C
STA PACTL ;turn off cassete motor
LDA #RESTRT&$FF ;Shove the restrt vector into
STA DOSVEC ;the DOS vector.
LDA #RESTRT^
STA DOSVEC+1
RTS
; WARMSTART ENTRY POINT
;
RESTRT: JMP BEGIN
;
;
; .....................
; Look, up in the sky! Its a helicopter, it's a plane. It's
; a saucer, no, it's Jack's wonderful 'SHOOT' game.
;
; Zero-Page-Variables
;(None of these variables Have to be on the zero page, but
;putting them here speeds up and shortens the code)
;
DLIC = $B0 ;Counter of display list interrupts
DSCOR = $B1 ;Delta score.
MX = $B2 ;Missile X coordinate
MDX = $B3 ;Missile X velocity
MY = $B4 ;Missile Y position (Zero means no missile
;on the screen.)
DSEC = $B5 ;mod 15 counter for score to second conversion
JIFF = $B6 ;mod 60 counter for jiffy to second conversion
STOP = $B7 ;Non zero neans ignore player's button. Used
;to keep him from firing unless we want him to.
;
; Data Tables
;
; MDLIST -- My display list. Consists of the standard-24-blank-scan-lines.
; 8 scan lines of text (the score and copyright line)
; 11 sets of 16 scan lines with a display list interrupt
; occuring at the start of each pair
; and a final jump & wait for vertical blank instruction
;
MDLIST: .BYTE DLBL8,DLBL8,DLBL8
.BYTE DLLDM+DLPF6 ;C
.ADDR SCORLN
.BYTE DLBL8+DLINT,DLBL8 ;1,2
.BYTE DLBL8+DLINT,DLBL8 ;3,4
.BYTE DLBL8+DLINT,DLBL8 ;5,6
.BYTE DLBL8+DLINT,DLBL8 ;7,8
.BYTE DLBL8+DLINT,DLBL8 ;9,10
.BYTE DLBL8+DLINT,DLBL8 ;11,12
.BYTE DLBL8+DLINT,DLBL8 ;13,14
.BYTE DLBL8+DLINT,DLBL8 ;15,16
.BYTE DLBL8+DLINT,DLBL8 ;17,18
.BYTE DLBL8+DLINT,DLBL8 ;19,20
.BYTE DLBL8+DLINT,DLBL8 ;21,22
.BYTE DLJVB
.ADDR MDLIST
;
; Message table
;
TMSG: .ASCII "(C)1981 J H PALEVICH" ;Horrible bugs will infest the code
;of who-so-ever changes this copyright
;message to something else!
;
; The next many tables are for the display list interrupt handler.
; They are all 11 bytes long, so that there is one byte in each
; table for each display list interrupt. The First DLI uses the
; rirst byte in the table, and so forth, so in the TCOLB table,
; for instance, the top of the sky is black, then the first DLI
; makes it turn CLBLUE, the second CLLBLU. and so on.
;
;
; TCOLB - table of colors for backround
; The sky starts out black and turns light blue, then
; the backround turns green for the 'ground' under the gun.
;
TCOLB: .BYTE CLBLUE,CLLBLU,CLBLUE+2
.BYTE CLLBLU+2,CLBLUE+4,CLLBLU+4
.BYTE CLBLUE+6,CLLBLU+6,CLBLUE+8
.BYTE CLLBLU+8,CLGREN+8
;
; TCOLP - COLOR PLAYER ZERO
; Player zero is the planes in the sky and the gun on the ground
;
TCOLP: .BYTE CLGREY+8,CLGOLD+8
.BYTE CLORNG+8,CLRED+8
.BYTE CLPINK+8,CLPURP+8
.BYTE CLPURB+8,CLPBLU+8
.BYTE CLBLUE,CLRED+8,CLRED+8
;
; TPX -- Players X position
; The gun it always stuck at 124.
; DPLANE takes care of the planes' x position.
; DLIH sets the X position to zero to kill the
; plane and get it off the screen.
;
TPX: .BYTE 0,1,2,3,4,5,6,7,8,124,124
;
; TDX -- Player's velocity.
; The gun is always zero, so it will not drift off
; to either side.
;
TDX: .BYTE 1,2,3,2,1,255,254,253
.BYTE 254,0,0
;
; TVAL -- PLAYER'S POINT-VALUE
;
; Set by DPLANE
; Used by DLIH
;
TVAL: .BYTE 1,2,3,4,5,6,7,8,9,10,11
;
; TWID -- width of the player
;
; 0 -- normal (two GR. 0 characters) wide
; 1 -- double (four Gr. 0 characters) wide
; The gun is double width
;
TWID: .BYTE 0,1,0,1,0,1,0,1,0,1,1
;
; That's the end of the tables used by the DLIH
; routine.
;
;
; JTAB -- missiles X velocity
; Used to convert from the joystick direction to
; the speed end direction of the missile. Used by VBLI.
;
JTAB: .BYTE 0,1,255,0
;
; GUNTAB -- Picture of gun in all three
; directions.
;
;........
;......++
;.....++.
;....++..
;...+++..
;..++++..
;.++++++.
;++++++++
GUNTAB: .BYTE 0,3,6,$C,$1C,$3C,$7E,$FF
;........
;++......
;.++.....
;..++....
;..+++...
;..++++..
;.++++++.
;++++++++
.BYTE 0,$C0,$60,$30,$38,$3C,$7E,$FF
;........