ROM Computer Magazine Archive ROM MAGAZINE ISSUE 4 — FEBRUARY/MARCH 1984 / PAGE 58


BASE HUNTER
By JACK CHUNG

BASE HUNTER   -  screen


    The year is 2119 and Earth has been in a cold war for the past twenty years with the planet Kenoke, which is approximately six light years away. The Kenokians have come up with a secret power field that protects their Base Ship from enemy attack. Since the Base Ship is the one that supplies all of the Kenokian's ships with fuel and repair this ship is the most important. Recently one of the Kenokian's Base Ship was spotted just one jump away from Earth. Rumor has it that their next jump will be Earth.
    While the Kenokians had been working on a protective shield for their Base Ships the Earthlings had been working on a weapon themselves. This weapon was a Particle Beam that can destroy almost anything, including the Kenokians shield. Because of the great strength of the shield one hit only makes a small dent in it, meaning it takes many hits to destroy the shield. The Kenokians can't fire at you unless you have broken completely through the shield. They then will fire what looks like a ball of fire, but is really pure energy. One hit from this and you're dead. When you hit the shield with your ship your ship will only bounce off, not doing any damage to the shield.
    You are one of Earth's last Fighter ships that has had the new Particle Beam installed. Your mission is to seek out and destroy the Base Ship without being killed yourself. Since there are only three ships altogether this makes the mission no easy task. Once you have destroyed one Base Ship a new Ship and Shield appears on the screen. The next shield moves down alot faster making it harder to break through.
    You move your fighter ship into position to fire at the shield with your Joystick. To fire your Particle Beam push your red button. To have rapid fire hold down your button when firing at the shield. Once you have blown a hole completely through the shield you are able to shoot the Base Ship. The Base Ship is also able to shoot you. The game is over when you have been shot three times.
    This game "Base Hunter" was written using Player/Missile and Character Graphics. The Synassembler was used to make the machine code because of its speed. The shield is a multicolor shield giving it a hypnotizing effect. The Earth's were made by redefining ATARI'S character set to give it a nicer looking display. This game requires 48K and one Joystick.
    If this program seems to long to type out send $6.00 to:
ROM MAGAZINE
P.O.BOX 252
MAPLE RIDGE,B.C.
V2X 7C5
    Specify whether you want Disk or Cassette.

Basic Listing
1 REM *BASE HUNTER REQUIRES 48K OF MEMORY*
2 REM WRITTEN BY JACK CHUNG ** ROM MAGAZINE VOL 1,ISSUE 4
3 GOSUB 3000
4 K=1:POKE 1736,101
5 MEN=3:BD=0
6 GRAPHICS 0:POKE 752,1
7 SETCOLOR 0,3,4:SETCOLOR 1,7,4:SETCOLOR 2,0,10
9 POKE 756,PEEK(106)-24:POKE 623,1
10 A=PEEK(560)+256*PEEK(561)
11 POKE A+2,112+128:POKE A+3,66+128
12 POKE A+6,4+128+32:POKE A+7,4+128+32
20 FOR I=8 TO 28:POKE I+A,4+128+32:NEXT I
30 POSITION 14,0:? "BASE HUNTER MEN=";MEN;" BD=";BD
40 FOR I=1 TO 40:POSITION INT(34*RND(1)+2),INT(20*RND(1)+2):? CHR$(INT(3*RND(1)+10)):NEXT I
50 FOR I=1 TO 3:POSITION INT(34*RND(1)+2),INT(20*RND(1)+1):? "":NEXT I:POKE 53278,1
900 IF K=1 THEN U=USR(24576)
1000 IF K=0 THEN U=USR(24576+2
1010 POKE 54286,128
1020 IF PEEK(1737)=5 THEN POKE 1737,0:GOTO 2000
1030 MEN=MEN-1:POSITION 31,0:? MEN
1040 IF MEN>0 THEN K=0:GOTO 100
1050 K=1:FOR I=0 TO 3:POKE 5328+I,0:NEXT I:SOUND 0,0,0,0:SOUND 1,0,0,0
1055 POSITION 10,0:? "PRESS START TO BEGIN    "
1060 IF PEEK(53279)<>6 THEN 100
1070 GOTO 5
2000 POKE 54286,128:FOR T=1 TO 4
2005 FOR I=1 TO 7 STEP 0.5:POKE 54277,I:SOUND 0,240,4,14:NEXT I
2010 FOR I=7 TO 0 STEP -0.5:POKE 54277,I:NEXT I
2040 NEXT T
2050 SOUND 0,0,0,0:SOUND 1,0,0,0:FOR I=0 TO 3:POKE 53248+I,0:NEXT I
2060 FOR T=1 TO 400:NEXT T
2070 POKE 54286,O:BD=BD+1:POSITION 34,0:? BD:K=1
2075 A=PEEK(1736):IF A>20 THEN A=A-20:POKE 1736,A
2080 GOTO 5
2095 REM LOAD MACHINE DATA
3000 RESTORE 4000:FOR I=24576 TO 25856:READ A:POKE I,A:NEXT I
3005 REM LOAD MACHINE DATA
3010 RESTORE 5000:FOR I=1536 T0 1700:READ A:POKE I,A:NEXT I
3015 REM LOAD CHARACTER DATA
3020 RESTORE 6000:FOR 1=34816 TO 35456:READ A:POKE I,A:NEXT I:RETURN
4000 DATA 104,169,0,153,0,116,153,0,115,153,0,118,153,0,119,169,255,153,0,117,200,208,234,76
4010 DATA 30,96,104,32,213,96,169,9,141,36,2,169,97,141,37,2,169,62,141,47,2,169,3,141
4020 DATA 29,208,169,112,141,7,212,169,0,141,0,2,169,6,141,1,2,169,70,141,1,208,169,60
4030 DATA 141,2,208,169,116,141,193,2,169,52,141,194,2,169,10,141,195,2,169,1,141,9,208,141
4040 DATA 11,208,141,30,208,169,180,141,27,100,169,100,141,28,100,169,30,141,22,100,169,3,141,31
4050 DATA 100,169,192,141,14,212,169,4,44,8,208,240,3,76,181,96,238,21,100,173,21,100,205,200
4060 DATA 6,144,8,169,0,141,21,100,32,210,98,169,1,44,15,208,240,70,169,1,141,3,208,141
4070 DATA 5,100,32,156,99,32,179,99,169,0,141,5,100,169,128,141,14,212,173,8,208,141,201,6
4080 DATA 32,178,98,32,156,99,169,0,141,0,210,141,1,210,141,2,210,141,3,210,96,169,0,170
4090 DATA 157,0,115,157,0,116,157,0,118,157,0,119,232,208,241,96,76,126,96,169,2,45,8,208
4100 DATA 240,22,172,30,100,162,0,185,0,117,10,10,153,0,117,200,232,224,16,144,242,32,178,98
4110 DATA 96,173,24,100,240,9,32,57,98,32,235,96,76,62,97,173,5,100,208,51,173,132,2,208
4120 DATA 29,169,1,141,24,100,173,27,100,24,105,3,141,29,100,173,28,100,24,105,5,141,30,100
4130 DATA 173,31,100,141,32,100,32,108,97,32,5,98,32,241,98,173,17,100,240,3,32,84,99,238
4140 DATA 36,100,173,36,100,141,18,208,169,2,44,12,208,240,10,169,1,141,30,208,169,4,141,31
4150 DATA 100,76,98,228,174,0,211,138,41,1,208,5,160,1,140,31,100,138,41,2,208,5,160,2
4160 DATA 140,31,100,138,41,4,208,12,173,31,100,201,4,240,29,160,3,140,31,100,138,41,8,208
4170 DATA 19,172,27,100,192,200,176,12,173,31,100,201,3,240,5,160,4,140,31,100,172,31,100,192
4180 DATA 1,208,14,173,28,100,56,233,2,141,28,100,169,16,141,34,100,192,2,208,16,208,188,173
4190 DATA 28,100,24,105,2,141,28,100,169,32,141,34,100,192,3,208,16,208,185,173,27,100,56,233
4200 DATA 1,141,27,100,169,48,141,34,100,192,4,208,23,173,27,100,24,105,1,141,27,100,162,64
4210 DATA 142,34,100,201,200,144,5,169,3,141,31,100,96,173,27,100,141,0,208,172,28,100,174,34
4220 DATA 100,189,37,100,153,0,116,200,202,238,33,100,173,33,100,201,16,144,238,169,0,141,33,100
4230 DATA 200,153,0,116,200,153,0,116,200,153,0,116,200,153,0,116,96,172,32,100,192,1,208,16
4240 DATA 173,30,100,56,233,3,141,30,100,201,30,176,3,76,178,98,192,2,208,16,173,30,100,24
4250 DATA 105,3,141,30,100,201,200,144,3,76,178,98,192,3,208,16,173,29,100,56,233,3,141,29
4260 DATA 100,201,40,176,3,76,178,98,192,4,208,16,173,29,100,24,105,3,141,29,100,201,200,144
4270 DATA 3,76,178,98,173,29,100,141,4,208,172,30,100,162,0,238,35,100,173,35,100,141,0,210
4280 DATA 169,200,141,1,210,189,7,100,153,0,115,200,232,224,8,208,244,96,160,0,140,4,208,140
4290 DATA 35,100,140,0,210,140,1,210,152,153,0,115,200,208,250,169,0,141,24,100,169,1,141,30
4300 DATA 208,96,160,0,185,0,117,200,153,0,120,192,254,144,245,185,0,117,141,30,120,160,0,185
4310 DATA 0,120,153,0,117,200,208,247,96,172,23,100,192,1,208,18,238,22,100,172,22,100,192,200
4320 DATA 144,8,169,2,141,23,100,76,32,99,172,23,100,192,2,208,15,206,22,100,172,22,100,192
4330 DATA 30,176,5,169,1,141,23,100,172,22,100,162,0,189,101,100,153,0,118,232,200,224,12,144
4340 DATA 244,173,17,100,208,29,172,22,100,204,28,100,208,21,185,0,117,208,16,169,1,141,17,100
4350 DATA 169,70,141,19,100,173,22,100,141,20,100,96,238,19,100,238,19,100,174,19,100,142,3,208
4360 DATA 142,2,210,169,136,141,3,210,224,200,144,3,76,156,99,172,20,100,174,18,100,208,8,162
4370 DATA 10,142,18,100,76,132,99,162,0,142,18,100,189,117,100,153,0,119,232,200,238,16,100,173
4380 DATA 16,100,201,10,144,238,169,0,141,16,100,96,169,0,141,2,210,141,3,210,141,17,100,141
4390 DATA 3,208,160,0,153,0,119,200,208,250,96,172,28,100,169,4,32,234,99,10,10,10,10,170
4400 DATA 189,37,100,153,0,116,202,200,238,16,100,173,16,100,201,14,144,238,169,0,141,16,100,32
4410 DATA 249,99,238,6,100,173,6,100,201,10,144,207,169,0,141,6,100,96,141,4,100,238,4,100
4420 DATA 173,10,210,205,4,100,176,248,96,169,0,133,20,165,20,201,2,208,250,96,0,0,0,0
4430 DATA 0,0,2,2,0,0,0,0,0,0,0,0,0,0,70,1,0,0,30,112,100,0,0,1
4440 DATA 1,0,10,0,0,0,0,0,130,254,254,108,108,56,56,16,0,0,0,0,0,0,0,0
4450 DATA 16,56,56,108,108,254,254,130,0,0,0,0,0,0,0,0,7,30,126,230,126,30,7,0
4460 DATA 0,0,0,0,0,0,0,0,224,120,126,103,126,120,224,0,0,0,0,0,0,0,240,96
4470 DATA 240,222,255,222,240,96,240,0,0,0,0,0,0,8,8,8,8,119,8,8,8,8,0,0
4480 DATA 0,65,34,20,8,20,34,65,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
4490 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
4500 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
4510 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
4520 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
4530 DATA 0,0,0,0,0,0,0,0,0
5000 DATA 72,138,72,238,139,100,174,139,100,189,31,6,141,10,212,141,19,208,224,26,208,5,169,0
5010 DATA 141,139,100,104,170,104,64,18,20,22,24,26,28,30,20,36,52,68,68,84,46,44,42,40
5020 DATA 38,36,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
5030 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
5040 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
5050 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
5060 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
6000 DATA 0,0,0,0,0,0,0,0,56,56,56,56,24,0,24,0,102,102,102,0,0,0,0,0
6010 DATA 102,255,102,102,255,102,0,0,24,62,96,60,6,124,24,0,0,102,108,24,48,102,70,0
6020 DATA 28,54,28,56,111,102,59,0,24,24,24,0,0,0,0,0,30,24,24,56,56,56,62,0
6030 DATA 120,24,24,28,28,28,124,0,0,102,60,255,60,102,0,0,0,24,24,126,24,24,0,0
6040 DATA 0,0,0,0,0,24,24,48,0,0,0,126,0,0,0,0,0,0,0,0,0,24,24,0
6050 DATA 3,6,12,24,48,96,64,0,127,99,99,99,99,99,127,0,56,24,24,24,62,62,62,0
6060 DATA 127,3,3,127,96,96,127,0,126,6,6,127,7,7,127,0,112,112,112,119,119,127,7,0
6070 DATA 127,96,96,127,7,7,127,0,124,108,96,127,99,99,127,0,127,3,3,31,24,24,24,0
6080 DATA 62,54,54,127,119,119,127,0,127,99,99,127,7,7,7,0,0,24,24,0,24,24,0,0
6090 DATA 0,24,24,0,24,24,48,0,6,12,24,48,24,12,6,0,0,126,0,0,126,0,0,0
6100 DATA 96,48,24,12,24,48,96,0,127,99,3,31,28,0,28,0,127,99,111,111,111,96,127,0
6110 DATA 63,51,51,127,115,115,115,0,126,102,102,127,103,103,127,0,127,103,103,96,99,99,127,0
6120 DATA 126,102,102,119,119,119,127,0,127,96,96,127,112,112,127,0,127,96,96,127,112,112,112,0
6130 DATA 127,99,96,111,103,103,127,0,115,115,115,127,115,115,115,0,12,12,12,12,60,60,60,0
6140 DATA 12,12,12,14,14,110,126,0,102,102,108,127,103,103,103,0,48,48,48,112,112,112,126,0
6150 DATA 103,127,127,119,103,103,103,0,103,119,127,111,103,103,103,0,127,99,99,103,103,103,127,0
6160 DATA 127,99,99,127,112,112,112,0,127,99,99,103,103,103,127,7,126,102,102,127,119,119,119,0
6170 DATA 127,96,127,3,115,115,127,0,127,28,28,28,28,28,28,0,103,103,103,103,103,103,127,0
6180 DATA 103,103,103,103,111,62,28,0,103,103,103,111,127,127,103,0,115,115,115,62,103,103,103,0
6190 DATA 103,103,103,127,28,28,28,0,127,102,108,24,55,103,127,0,30,24,24,24,24,24,30,0
6200 DATA 64,96,48,24,12,6,3,0,120,24,24,24,24,24,120,0,0,8,28,54,99,0,0,0
6210 DATA 0,0,0,0,0,0,255,0,0,54,127,127,62,28,8,0,0,0,0,2,10,58,191,171
6220 DATA 0,0,0,165,170,170,170,169,0,0,0,0,128,160,164,168,171,175,191,175,170,170,43,42
6230 DATA 229,229,233,170,234,234,234,250,168,168,104,104,104,104,80,160,10,2,0,0,0,0,0,0
6240 DATA 186,170,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,32,32,0
6250 DATA 0,0,0,16,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
6260 DATA 0,0,0,0,0,0,255,255,0,0,0,0,240,240,240,240,0

Assembler Listing

00010           .LI OFF
00020
00030 *************************
00040 * BASE HUNTER           *
00050 *          BY           *
00060 *            JACK CHUNG *
00070 *************************
00080 ;
00090 ;
00100 ;
00110 VERTI     .EQ $200
00120 SDMCTL    .EQ 559
00130 XITVBV    .EQ $E462
00140 DMACTL    .EQ $22F
00150 DLST      .EQ $230
00160 GRACTL    .EQ $D01D
00170 PMBASE    .EQ $D407
00180 COLPMO    .EQ $DO12
00190 HPOSPO    .EQ $D000
00200 STICK     .EQ $D300
00210 TRIGO     .EQ 644
00220 NMIEN     .EQ $D40E
00230
00240 ADR       .EQ $80
00250 SCRN      .EQ $58
00260 LDM       .EQ $82
00270 JVB       .EQ $41
00280
00290           .OR $7000
00300 RIGHT     .EQ $8
00310 LEFT      .EQ $4
00320 DOWN      .EQ $2
00330 UP        .EQ $1
00340 HSPEED    .EQ 1
00350 VSPEED    .EQ 2
00351 SPEED     .EQ 1736
00360 WSYNC     .EQ $D40A
00370 FREQ      .EQ $D200 ;SOUND
00380 CONTROL   .EQ $D201 ;CHANNELS
00390 FREQ1     .EQ $D202 ;0 & 1
00400 CONTROL1  .EQ $D203 ;
00410 ;
00420 ;*PLAYER MISSLE LOCATION*
00430 ;
00440 PLAYER    .EQ $4000
00450
00460 ; CLEAR ALL THE PLAYERS
00470 ; LOCATIONS
00480 ;
00490 START   PLA
00500 L02     LDA #0
00510         STA PLAYER+$400,Y
00520         STA PLAYER+$300,Y
00530         STA PLAYER+$600,Y
00540         STA PLAYER+$700,Y
00550         LDA #255
00560         STA PLAYER+$500,Y
00570         INY
00580         BNE L02
00590         JMP SKIP1
00600 ;
00610 ;
00620 START1  PLA
00621         JSR CLR
00630 SKIP1   LDA #MAIN    ;SET
00640         STA 548      ;VBLANK
00650         LDA /MAIN    ;INTERUPT
00660         STA 549
00670         LDA #62      ;SET
00680         STA SDMCTL   ;PLAYER
00690         LDA #$03     ;MISSLE
00700         STA GRACTL   ;
00710         LDA /PLAYER  ;
00720         STA PMBASE
00730         LDA #0       ;SET
00740         STA 512      ;DLIST
00750         LDA #6       ;INTERUPT
00760         STA 513      ;
00770 *                    ;I
00780 *                    ;N
00790         LDA #70      ;I
00800         STA 53249    ;T
00810         LDA #60      ;I
00820         STA 53250    ;A
00830         LDA #$74     ;L
00840         STA 705      ;I
00850         LDA #$34     ;Z
00860         STA 706      ;E
00870         LDA #$0A     ;
00880         STA 707      ;S A P
00890 *                    ;C N M
00900 *                    ;R D
00910         LDA #1       ;E
00920         STA 53257    ;E
00930         STA 53259    ;N
00940         STA 53278    ;
00950         LDA #180
00960         STA OX
00970         LDA #100
00980         STA OY
00990         LDA #30
01000         STA MONY
01010         LDA #3
01020         STA DIR
01030         LDA #192     ;START
01040         STA NMIEN    ;
01050 LO      LDA #4
01060         BIT 53256
01070         BEQ .2
01080         JMP BASIC
01090 .2      INC COUNTER  ;SLOW
01100         LDA COUNTER  ;SPINNING
01110         CMP SPEED    ;SPHERE
01120         BCC SKIP     ;DOWN
01130         LDA #0
01140         STA COUNTER
01150         JSR SPHERE
01160 SKIP    LDA #1
01170         BIT 53263    ;YSHIP HIT
01180         BEQ GOTHERE  ;YES!
01190         LDA #1
01200         STA 53251    ;SHIP
01210         STA DEAD     ;HIT
01220         JSR END      ;ROUTINE
01230         JSR EXPLODE
01240         LDA #0
01250         STA DEAD
01260 BASIC   LDA #128     ;JUMP BACK
01270         STA NMIEN    ;TO BASIC
01271         LDA 53256
01272         STA 1737
01280         JSR FINISH
01281         JSR END
01282         LDA #0
01290         STA FREQ     ; SHUT
01300         STA CONTROL  ; SOUND
01310         STA FREQ1    ; OFF
01320         STA CONTROL1 ;
01321         RTS
01322 ;
01323 ;
01330 CLR     LDA #0
01340         TAX
01350 CLR1    STA PLAYER+$300,X
01360         STA PLAYER+$400,X
01370         STA PLAYER+$600,X
01380         STA PLAYER+$700,X
01390         INX
01400         BNE CLR1
01410         RTS
01420 ;
01430 ;
01440 GOTHERE JMP LO
01450 ;
01460 ;
01470 HIT     LDA #2      ;SEE IS
01480         AND 53256   ;SPHERE HIT
01490         BEQ NOTHIT  ;NO !
01500         LDY MY
01510         LDX #0
01520 L9      LDA PLAYER+$500,Y
01530         ASL
01540         ASL
01550         STA PLAYER+$500,Y
01560         INY         ;PUNCH A
01570         INX         ;HOLL IN
01580         CPX #16     ;THE
01590         BCC L9      ;SPINNING
01600         JSR FINISH  ;SPHERE
01610 NOTHIT  RTS
01620 ;
01630 ;
01640 MAIN    LDA FLIGHT  ;SEE MISSLE
01650         BEQ CONT    ;IN FLIGHT
01660         JSR MISSLE
01670         JSR HIT
01680         JMP CONT1
01690 ;
01700 ;
01710 CONT    LDA DEAD
01720         BNE NO
01730         LDA TRIGO   ;PRESS
01740 *                   ;TRIGGER
01750         BNE CONT1   ;NO!
01760         LDA #1
01770         STA FLIGHT
01780         LDA OX      ;OFFSET
01790         CLC         ;MISSLE
01800         ADC #3      ;STARTING
01810         STA MX      ;LOCATION
01820         LDA OY      ;SO IT
01830         CLC         ;STARTS
01840         ADC #5      ;AT THE
01850         STA MY      ;PROPER
01860         LDA DIR     ;LOCATION
01870         STA MDIR
01880 CONT1   JSR RSTICK
01890         JSR MOVE
01900         JSR MONSTER
01910         LDA OK
01920         BEQ NO
01930         JSR WAVE
01940 NO      INC FRAME    ;FLASH
01950         LDA FRAME    ;YSHIP'S
01960         STA COLPMO   ;COLOR
01970         LDA #2
01980         BIT 53260
01990         BEQ EXIT
02000         LDA #1
02010         STA 53278
02020         LDA #4
02030         STA DIR
02040 EXIT    JMP XITVBV
02050
02060 ;CHECK THE JOYSTICK AND
02070 ;MOVE THE SHIP IN THE
02080 ;THE APPROPRIATE DIRECTIONS
02090 ;
02100 ;
02110 RSTICK  LDX STICK
02120         TXA
02130         AND #UP
02140         BNE .1
02150         LDY #1
02160         STY DIR
02170 .1      TXA
02180         AND #DOWN
02190         BNE .2
02200         LDY #2
02210         STY DIR
02220 .2      TXA
02230         AND #LEFT
02240         BNE .3
02250         LDA DIR
02260         CMP #4
02270         BEQ .4
02280         LDY #3
02290         STY DIR
02300 .3      TXA
02310         AND #RIGHT
02320         BNE .4
02330         LDY OX
02340         CPY #200
02350         BCS .4
02360         LDA DIR
02370         CMP #3
02380         BEQ .4
02390         LDY #4
02400         STY DIR
02410 .4      LDY DIR
02420         CPY #1
02430         BNE .11
02440         LDA OY
02450         SEC
02460         SBC #VSPEED
02470         STA OY
02480         LDA #16
02490         STA IMAGE
02500 .11     CPY #2
02510         BNE .22
02520         BNE .2
02530         LDA OY
02540         CLC
02550         ADC #VSPEED
02560         STA OY
02570         LDA #32
02580         STA IMAGE
02590 .22     CPY #3
02600         BNE .33
02610         BNE .3
02620         LDA OX
02630         SEC
02640         SBC #HSPEED
02650         STA OX
02660         LDA #48
02670         STA IMAGE
02680 .33     CPY #4
02690         BNE .44
02700         LDA OX
02710         CLC
02720         ADC #HSPEED
02730         STA OX
02740         LDX #64
02750         STX IMAGE
02760         CMP #200
02770         BCC .44
02780         LDA #3
02790         STA DIR
02800 .44     RTS
02810
02820 MOVE    LDA OX
02830         STA HPOSPO
02840         LDY OY
02850         LDX IMAGE
02860 MOO     LDA SHAPE,X
02870         STA PLAYER+$400,Y
02880         INY
02890         DEX
02900         INC C
02910         LDA C
02920         CMP #16
02930         BCC MOO
02940         LDA #0
02950         STA C
02960         INY
02970         STA PLAYER+$400,Y
02980         INY
02990         STA PLAYER+$400,Y
03000         INY
03010         STA PLAYER+$400,Y
03020         INY
03030         STA PLAYER+$400,Y
03040         RTS
03050 ;
03060 ;CHECK THE MISSLE DIRECTION
03070 ;AND MOVE THE MISSLE IN
03080 ;THE APPROPRIATE DIRECTION
03090 ;
03100 ;
03110 MISSLE  LDY MDIR
03120         CPY #1
03130         BNE .1
03140         LDA MY
03150         SEC
03160         SBC #3
03170         STA MY
03180         CMP #30
03190         BCS .1
03200         JMP FINISH
03210 .1      CPY #2
03220         BNE .2
03230         LDA MY
03240         CLC
03250         ADC #3
03260         STA MY
03270         CMP #200
03280         BCC .2
03290         JMP FINISH
03300 .2      CPY #3
03310         BNE .3
03320         LDA MX
03330         SEC
03340         SBC #3
03350         STA MX
03360         CMP #40
03370         BCS .3
03380         JMP FINISH
03390 .3      CPY #4
03400         BNE .4
03410         LDA MX
03420         CLC
03430         ADC #3
03440         STA MX
03450         CMP #200
03460         BCC .4
03470         JMP FINISH
03480 .4      LDA MX
03490         STA $DO04
03500         LDY MY
03510         LDX #0
03520         INC SOUNDX
03530         LDA SOUNDX
03540         STA FREQ
03550         LDA #$C8
03560         STA CONTROL
03570 LOOP    LDA MIMAGE,X
03580         STA PLAYER+$300,Y
03590         INY
03600         INX
03610         CPX #8
03620         BNE LOOP
03630         RTS
03640 ;
03650 ;CLEAR OUT MISSLE LOCATION
03660 ;AND CLEAR COLLISION REGISTER
03670 ;ALSO SHUT OFF SOUNDS
03680 ;
03690 ;
03700 FINISH  LDY #0
03710         STY 53252
03720         STY SOUNDX
03730         STY FREQ
03740         STY CONTROL
03750         TYA
03760 .1      STA PLAYER+$300,Y
03770         INY
03780         BNE .1
03790         LDA #0
03800         STA FLIGHT
03810         LDA #1
03820         STA 53278
03830         RTS
03840 ;
03850 ;
03860 ;ROTATE THE SPHERE
03870 ;
03880 SPHERE  LDY #0
03890 .2      LDA PLAYER+$500,Y
03900         INY
03910         STA PLAYER+$800,Y
03920         CPY #254
03930         BCC .2
03940         LDA PLAYER+$500,Y
03950         STA PLAYER+$800+$lE
03960         LDY #0
03970 .4      LDA PLAYER+$800,Y
03980         STA PLAYER+$500,Y
03990         INY
04000         BNE .4
04010         RTS
04020 ;
04030 ;
04040 MONSTER LDY MODIR
04050         CPY #1
04060         BNE .11    ;GO UP
04070         INC MONY
04080         LDY MONY
04090         CPY #200
04100         BCC .11
04110         LDA #2
04120         STA MODIR
04130         JMP LO
04140 ;
04150 ;
04160 .11     LDY MODIR
04170         CPY #2
04180         BNE LO
04190         DEC MONY
04200         LDY MONY
04210         CPY #30
04220         BCS LO
04230         LDA #1
04240         STA MODIR
04250 LO      LDY MONY
04260         LDX #0
04270 L1      LDA MSHAPE,X
04280         STA PLAYER+$600,Y
04290         INX
04300         INY
04310         CPX #12
04320         BCC Ll
04330         LDA OK
04340         BNE FINI
04350         LDY MONY
04360         CPY OY
04370         BNE FINI
04380         LDA PLAYER+$500,Y
04390         BNE FINI
04400         LDA #1
04410         STA OK
04420         LDA #70
04430         STA WAVEX
04440         LDA MONY
04450         STA WAVEY
04460 FINI    RTS
04470 ;
04480 ;
04490 WAVE    INC WAVEX
04500         INC WAVEX
04510         LDX WAVEX
04520         STX 53251
04530         STX FREQ1
04540         LDA #$88
04550         STA CONTROL1
04560         CPX #200
04570         BCC .2
04580         JMP END
04590 .2      LDY WAVEY
04600         LDX IM
04610         BNE .1
04620         LDX #10
04630         STX IM
04640         JMP DRAW
04650 .1      LDX #0
04660         STX IM
04670 DRAW    LDA LSHAPE,X
04680         STA PLAYER+$700,Y
04690         INX
04700         INY
04710         INC COUNT
04720         LDA COUNT
04730         CMP #10
04740         BCC DRAW
04750         LDA #0
04760         STA COUNT
04770         RTS
04780 ;
04790 END     LDA #0
04800         STA FREQ1
04810         STA CONTROL1
04820         STA OK
04830         STA 53251
04840         LDY #0
04850 L2      STA PLAYER+$700,Y
04860         INY
04870         BNE L2
04880         RTS
04890 ;
04900 EXPLODE LDY OY
04910         LDA #4
04920         JSR RANDOM
04930         ASL     ;*2
04940         ASL     ;*4
04950         ASL     ;*8
04960         ASL     ;*16
04970         TAX
04980 DR      LDA SHAPE,X
04990         STA PLAYER+$400,Y
05000         DEX
05010         INY
05020         INC COUNT
05030         LDA COUNT
05040         CMP #14
05050         BCC DR
05060         LDA #0
05070         STA COUNT
05080         JSR DELAY
05090         INC SPIN
05100         LDA SPIN
05110         CMP #10
05120         BCC EXPLODE
05130         LDA #0
05140         STA SPIN
05150         RTS
05160 ;
05170 RANDOM  STA RTEMP
05180         INC RTEMP
05190 RNDWAIT LDA 53770
05200         CMP RTEMP
05210         BCS RNDWAIT
05220         RTS
05230 ;
05240 DELAY   LDA #0
05250         STA 20
05260 DELAY2  LDA 20
05270         CMP #2
05280         BNE DELAY2
05290         RTS
05300 RTEMP   .DA #0
05310 DEAD    .DA #0
05320 SPIN    .DA #0
05330 MIMAGE  .DA #0,#0,#0,#2,2,#0,#0,#0
05340 COUNT   .DA #0
05350 OK      .DA #0
05360 IM      .DA #0
05370 WAVEX   .DA #0
05380 WAVEY   .DA #0
05390 COUNTER .DA #0
05400 MONY    .DA #70
05410 MODIR   .DA #1
05420 FLIGHT  .DA #0
05430 TEMP    .DA #0
05440 YPOS    .DA #30
05450 OX      .DA #112
05550 OY      .DA #100
05560 MX      .DA #0
05570 MY      .DA #0
05580 DIR     .DA #1
05590 MDIR    .DA #1
05600         .DA #56,#108,#108,#254
05610         .DA #254,#130,#0,#0,#0
05620         .DA #0,#0
05630 C       .DA #0
05640 IMAGE   .DA #10
05650 SOUNDX  .DA #0
05660 FRAME   .HS 00
05670 SHAPE
05680         .DA #0,#0,#0,#130,#254
05690         .DA #254,#108,#108,#56
05700         .DA #56,#56,#16,#0,#0
05710         .DA #0,#0,#0
05720         .DA #0,#0,#0,#16,#56
05730         .DA #0,#0,#0,#7,#30
05740         .DA #126,#230,#126,#30
05750         .DA #7,#0,#0,#0,#0,#0
05760         .DA #0
05770         .DA #0,#0,#0,#224,#120
05780         .DA #126,#103,#126
05790         .DA #120,#224,#0,#0
05800         .DA #0,#0,#0,#0
05810 ;
05820 ;
05830 MSHAPE
05840         .DA #0,#240,#96,#240
05850         .DA #222,#255,#222
05860         .DA #240,#96,#240,#0
05870         .DA #0,#0,#0,#0,#0
05880 LSHAPE
05890         .DA #8,#8,#8,#8,#119
05900         .DA #8,#8,#8,#8,#0,#0
05910         .DA #0,#65,#34,#20,#8
05920         .DA #20,#34,#65,#0
05930         .DA #0,#0
05940 COUNTR  .DA #0
05950         .OR $600
05960         PHA
05970         TXA
05980         PHA
05990         INC COUNTR
06000         LDX COUNTR
06010         LDA COLBAK,X
06020         STA WSYNC
06030         STA $D013
06040         CPX #26
06050         BNE ENDDLI
06060         LDA #$00
06070         STA COUNTR
06080 ENDDLI  PLA
06090         TAX
06100         PLA
06110         RTI
06120 COLBAK  .DA #$12,#$14,#$16
06130         .DA #$18,#$lA,#$lC,#$lE
06140         .DA #$14,#$24,#$34
06150         .DA #$44,#$44,#$54
06160         .DA #$44,#$44,#$54
06170         .DA #$2E,#$2C,#$2A
06180         .DA #$28,#$26,#$24,#$22