A.N.A.L.O.G. ISSUE 16 / FEBRUARY 1984 / PAGE 87
Shooting Stars is an assembly-language game that strands you on an asteroid with almost zero gravity. Red-hot particles of space debris are bouncing all around you. Death is virtually certain in this hostile environment. The question is, how long can you survive?
Your objective is to avoid contact with the “shooting stars” for as long as possible. You are represented by a little astronaut figure, which can be moved around the screen with a joystick plugged into port #1.
You begin the game with five lives. The number of lives remaining is displayed in the top part of the screen, along with a clock which shows how long you have survived. An extra life is awarded at the 3-minute mark, and another at the 5-minute mark. A bell will signal the earning of an extra life. The longer you remain alive, the faster the flying particles will move.
I hope you enjoy playing Shooting Stars. See if you can beat my high score of five minutes and fourteen seconds.
Before typing anything into your computer, take a look at the program listings accompanying this article.
Listing 1 is the main data and data checking routine. This listing is used to create both the cassette and disk versions of Shooting Stars. The DATA statements are listed in hexadecimal (base 16) so that the program will fit in a 16K cassette-based system. This makes typing a little more difficult, but it’s a necessary evil.
Listing 2 must be added to Listing 1 if you are using a 410 or 1010 cassette drive.
Listing 3 must be added to Listing 1 if you are using a disk drive.
Listing 4 is the assembly-language source code for Shooting Stars, created with the Atari Macro Assembler. You do not have to type in this listing to play the game! It’s provided for those readers who want to study how the program works.
Follow the instructions below to make either a cassette or disk version of Shooting Stars.
1 REM *** SHOOTING STARS *** 10 DATA 0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0,0,10,11,12,13,14,15 20 DIM DAT$(91),HEX(22):FOR X=0 TO 22: READ N:HEX(X)=N:NEXT X:LINE=990:RESTOR E 1000:TRAP 60:? "CHECKING DATA" 25 LINE=LINE+10:? "LINE:";LINE:READ DA T$:IF LEN(DAT$)<>90 THEN 110 28 DATLIN=PEEK(183)+PEEK(184)*256:IF D ATLIN<>LINE THEN ? "LINE ";LINE;" MISS ING!":END 30 FOR X=1 TO 89 STEP 2:D1=ASC(DAT$(X, X))-48:D2=ASC(DAT$(X+1,X+1))-48:BYTE=H EX(D1)*16+HEX(D2) 35 IF PASS=2 THEN PUT #1,BYTE:NEXT X:R EAD CHKSUM:GOTO 25 40 TOTAL=TOTAL+BYTE:IF TOTAL>999 THEN TOTAL=TOTAL-1000 45 NEXT X:READ CHKSUM:IF TOTAL=CHKSUM THEN 25 50 GOTO 110 60 IF PEEK(195)<>6 THEN 110 100 ? "WRITING FILE":PASS=2:LINE=990:R ESTORE 1000:TRAP 60:GOTO 25 110 ? "BAD DATA: LINE ";LINE:END 1000 DATA A209A9FF9D30259DDE26CA10F7A2 29A92585D6A93A85D5A009B9122591D58810F8 A5D518690A85D5A5D6690085,695 1010 DATA D6CA10E6A9CA8D3002A9248D3102 A90085CD85CB85CF85D185D3A93385CEA93485 CCA93585D0A93685D2A93785,788 1020 DATA D4A9108D42068D43068DA006A900 8DA1068DA2068DA3068D6006A9058D5006A9B4 8D0006AD0AD24A1869378D01,948 1030 DATA 06A200AD0AD24A4A69329D1006E8 E006D0F1A2008A0A0A0A0A0A69379D2006E8E0 06D0F0A200AD0AD229039D30,321 1040 DATA 06E8E006D0F3A9308D07D4A93E8D 2F02A9038D1DD0A900A891CB91CD91CF91D191 D3C8D0F3A9008D45068D1ED0,300 1050 DATA A9468DC002A90F8DC1028DC2028D C302A9968DC502A9368DC602A9F88DC402A903 8D4106A907A224A080205CE4,446 1060 DATA AD1FD0C906D0034C6824AD780229 01D003CE0106AD78022908D003EE0006AD7802 2902D003EE0106AD78022904,186 1070 DATA D003CE0006AD0006C9C8D003CE00 06AD0006C932D003EE0006AD0106C934D003EE 0106AD0106C9C8D003CE0106,391 1080 DATA AD00068D00D0A200AC0106BDFF24 91CBE8C8E013D0F5A200BD3006D006FE1006DE 2006BD3006C901D006FE1006,306 1090 DATA FE2006BD3006C902D006DE1006FE 2006BD3006C903D006DE1006DE2006E8E006D0 C9A200BD1006C9CAD012BD30,69 1100 DATA 06D008A9039D3006189005A9029D 3006BD1006C930D014BD3006C902F008A9009D 3006189005A9019D3006BD20,766 1110 DATA 06C934D012BD3006D008A9019D30 06189005A9029D3006BD2006C9D5D014BD3006 C901D008A9009D3006189005,729 1120 DATA A9039D3006E8E006D093AD10068D 01D0AD11068D02D0AD12068D03D0AD13068D05 D0AD14068D06D0AD15068D07,24 1130 DATA D0A900AC200691CFA910C891CFC8 91CFA900C891CFA900AC210691D1A910C891D1 C891D1A900C891D1A900AC22,98 1140 DATA 0691D3A910C891D3C891D3A900C8 91D3A9EFAC230631CD91CDA910C811CD91CDA9 10C811CD91CDA9EFC831CD91,628 1150 DATA CDA9FBAC240631CD91CDA904C811 CD91CDA904C811CD91CDA9FBC831CD91CDA9BF AC250631CD91CDA940C811CD,19 1160 DATA 91CDA940C811CD91CDA9BFC831CD 91CDEE4006AD4006C910D03AA9008D4006CE41 06AD4106D005A9038D4106A9,239 1170 DATA C88D03D2AD4106C903D008A9788D 02D2189014AD4106C902D008A9648D02D21890 05A9558D02D2AD42068D2525,812 1180 DATA AD43068D2625ADA0068D2325ADA0 06C913D015ADA106D010EE5006EEA106A9A48D 01D2A9018DA206ADA006C915,632 1190 DATA D017ADA106C901D010EE5006EEA1 06A9A48D01D2A9018DA206AD4506F0034C1724 A9504E42060838ED4206282E,6 1200 DATA 4206A200EDA006E8E003D0F8AAA0 00C8D0FDCAD0F8ADA206C901D017A9328D00D2 EEA306ADA306C925D008EEA2,154 1210 DATA 06A9008DA306ADA206C902D017A9 288D00D2EEA306ADA306C925D008EEA206A900 8DA306ADA206C903D017A920,39 1220 DATA 8D00D2EEA306ADA306C925D008EE A206A9008DA306ADA206C904D00DA9008D00D2 8D01D2A9008DA306A98AA200,65 1230 DATA 9D2925E8EC5006D0F74C0E21CE50 06A9A88D01D28D03D2A9328D00D2481869648D 02D28DC00268A000A200E8D0,192 1240 DATA FDC8C019D0F6186901C964D0DFA9 008D00D28D01D28D02D28D03D2A9468DC002A9 00AC5006992925AD5006F003,491 1250 DATA 4C7920A9008D5006AD8402F007AD 1FD0C906D0F4A900854D4C5B20AD09D00D0AD0 0D0BD00D0DD00D0ED00D0FD0,877 1260 DATA 29018D4506EE6006AD6006C93CD0 26A9008D6006EE4306AD4306C91AD017A9108D 4306EE4206AD4206C916D008,77 1270 DATA EEA006A9108D42064C62E4707070 471C2509090909090909090909090909090909 090909090909090909090909,5 1280 DATA 0909090909090909090909090909 090941CA24007C546C7C447C1010FEBABABA38 382828EE0080000000000000,486 1290 DATA 000001000074696D6500001A0000 00000000000000000000000000000000000000 000000000000000000000000,944
2 REM *** CASSETTE VERSION *** 65 IF PASS=2 THEN FOR X=1 TO 18:PUT #1,0:NEXT X:CLOSE #1:END 70 ? "READY CASSETTE AND PRESS RETURN" ;:OPEN #1,8,128,"C:":RESTORE 200:FOR X =1 TO 40:READ N:PUT #1,N:NEXT X 200 DATA 0,11,216,31,255,31,169,0,141, 47,2,169,60,141,2,211,169,0,141,231,2, 133,14,169,56,141,232,2 210 DATA 133,15,169,0,133,10,169,32,13 3,11,24,96
2 REM *** DISK VERSION *** 65 IF PASS=2 THEN PUT #1,224:PUT #1,2:PUT #1,225:PUT #1,2:PUT #1,0:PUT #1,32 :CLOSE #1:END 70 ? "INSERT DISK WITH DOS, PRESS RETU RN";:DIM IN$(1):INPUT IN$:OPEN #1,8,0, "D:AUTORUN.SYS" 90 PUT #1,255:PUT #1,255:PUT #1,0:PUT #1,32:PUT #1,69:PUT #1,37
; ; Shooting stars by Dennis Fox ; ; Page zero usage PBASE = $CB ;POINTERS TO... MBASE = $CD ;MISSILES, BASE2 = $CF ;PLAYER1, BASE3 = $D1 ;PLAYER2, BASE4 = $D3 ;PLAYER3 ADDR = $D5 ;2-BYTE POINTER ; Page 6 usage X = $600 Y = $601 XM = $610 YM = $620 DM = $630 T1 = $640 T2 = $641 TI1 = $642 TI2 = $643 HIT = $645 LIFE = $650 TI3 = $660 TI4 = $6A0 ELF = $6A1 SF1 = $6A2 STIME = $6A3 ; Operating system equates ATTRAC = $4D ;ATTRACT MODE POINTER PCOLR0 = $2C0 ;PLAYER COLORS PCOLR1 = $2C1 PCOLR2 = $2C2 PCOLR3 = $2C3 COLOR0 = $2C4 ;PLAYFIELD COLORS COLOR1 = $2C5 COLOR2 = $2C6 COLOR3 = $2C7 COLOR4 = $2C8 SDMCTL = $22F ;DMA CONTROL SDLSTL = $230 ;DISP LIST POINTER SDLSTH = $231 STICK0 = $278 ;JOYSTICK STRIG0 = $284 ;STICK BUTTON HITCLR = $D01E ;COLLISION CLEAR HPOSP0 = $D000 ;P/M HOR. POSITIONS HPOSP1 = $D001 HPOSP2 = $D002 HPOSP3 = $D003 HPOSM0 = $D004 HPOSM1 = $D005 HPOSM2 = $D006 HPOSM3 = $D007 M1PL = $D009 ;COLLISION REGISTERS M2PL = $D00A M3PL = $D00B P1PL = $D00D P2PL = $D00E P3PL = $D00F GRACTL = $D01D ;GRAPHIC CONTROL CONSOL = $D01F ;CONSOLE BUTTONS AUDF1 = $D200 ;AUDIO CONTROLS AUDC1 = $D201 AUDF2 = $D202 AUDC2 = $D203 RANDOM = $D20A ;RANDOM # PMBASE = $D407 ;P/M START ADDR SETVBV = $E45C ;VERT BLANK SET VECTOR XITVBV = $E462 ;VERT BLANK EXIT ; set up screen and display list ORG $2000 SSTAR LDX #9 LDA #$FF SETTB STA SCRNA,X ;SET TOP... STA SCRNC,X ;AND BOTTOM... DEX ;OF SCREEN BPL SETTB LDX #41 LDA #SCRNB/256 ;POINT TO... STA ADDR+1 ;MIDDLE OF SCREEN LDA #SCRNB&255 STA ADDR SETMID LDY #9 MIDLP LDA MIDBYT,Y ;COPY MIDDLE BYTES... STA (ADDR),Y ;TO SCREEN RAM DEY BPL MIDLP LDA ADDR ;NOW ADD 10 BYTES... CLC ;TO POINT TO... ADC #10 ;NEXT LINE STA ADDR LDA ADDR+1 ADC #0 STA ADDR+1 DEX ;ANOTHER LINE? BPL SETMID ;YES! LDA #DLIST&255 ;POINT TO STA SDLSTL ;DISPLAY LDA #DLIST/256 ;LIST STA SDLSTH LDA #$00 ;SET LOW BYTES... STA MBASE ;OF P/M POINTERS STA PBASE STA BASE2 STA BASE3 STA BASE4 LDA #$33 ;NOW SET HI BYTES STA MBASE+1 ;TO POINT TO LDA #$34 ;VARIOUS P/M AREAS STA PBASE+1 LDA #$35 STA BASE2+1 LDA #$36 STA BASE3+1 LDA #$37 STA BASE4+1 ; Set players starting position START2 LDA #16 ;INITIALIZE TIMERS STA TI1 STA TI2 STA TI4 LDA #$00 STA ELF STA SF1 STA STIME STA TI3 LDA #5 ;START W/5 LIVES STA LIFE START LDA #180 ;SET UP... STA X ;ASTRONAUT X LDA RANDOM ;NOW GET... LSR A ;RANDOM # CLC ;AND SET UP ADC #55 ;ASTRONAUT Y STA Y ; Set missles horizontal position LDX #$00 ;GET RANDOM... L1 LDA RANDOM ;HORIZONTAL LSR A ;POSITION, LSR A ;MAKE SURE IT'S ADC #50 ;ON SCREEN, STA XM,X ;STORE IT INX ;NEXT MISSILE CPX #6 ;ALL DONE? BNE L1 ;NOT YET! ; Set missles vertical position LDX #$00 ;START W/MISSILE 0 L2 TXA ;GET MISSILE # ASL A ;MULTIPLY... ASL A ;MISSILE... ASL A ;NUMBER... ASL A ;BY 32, ASL A ;MAKE SURE IT'S... ADC #55 ;ON SCREEN, STA YM,X ;AND STORE IT! INX ;NEXT MISSILE CPX #6 ;ALL DONE? BNE L2 ;NOT YET! ; Set missiles' starting directions LDX #$00 L3 LDA RANDOM ;GET RANDOM... AND #$03 ;DIRECTION STA DM,X ;AND STORE INX ;NEXT MISSILE CPX #6 ;ALL DONE? BNE L3 ;NOT YET! ; Set up player missile graphics ; Single line resolution LDA #$30 ;POINT TO P/M AREA STA PMBASE LDA #62 ;TURN ON SCREEN STA SDMCTL LDA #3 ;SET P/M GRAPHICS STA GRACTL LDA #$00 ;NOW CLEAR OUT... TAY ;ALL MISSILES A1 STA (PBASE),Y ;AND PLAYERS STA (MBASE),Y STA (BASE2),Y STA (BASE3),Y STA (BASE4),Y INY BNE A1 LDA #$00 ;NO COLLISION! STA HIT STA HITCLR LDA #$46 ;SET UP COLORS STA PCOLR0 LDA #15 STA PCOLR1 STA PCOLR2 STA PCOLR3 LDA #150 STA COLOR1 LDA #54 STA COLOR2 LDA #$F8 STA COLOR0 LDA #3 STA T2 LDA #$07 ;NOW START UP... LDX #VBI/256 ;OUR VERTICAL BLANK... LDY #VBI&255 ;INTERRUPT! JSR SETVBV ; The game begins here BACK LDA CONSOL ;CHECK CONSOLE KEYS CMP #6 ;START PRESSED? BNE JOY2 ;NOPE! JMP DEATH ;GO TO RESTART! ; Read joystick JOY2 LDA STICK0 ;GET ASTRONAUT... AND #1 ;DIRECTION BNE O1 DEC Y ;UP O1 LDA STICK0 AND #$08 BNE O2 INC X ;RIGHT O2 LDA STICK0 AND #$02 BNE O3 INC Y ;DOWN O3 LDA STICK0 AND #$04 BNE O4 DEC X ;LEFT O4 LDA X ;GET ASTRO. X CMP #200 ;TOO FAR RIGHT? BNE O5 ;IT'S OK DEC X ;TOO FAR! O5 LDA X CMP #50 ;TOO FAR LEFT? BNE O6 ;OK. INC X ;TOO FAR! O6 LDA Y ;GET ASTRO. Y CMP #52 ;TOO FAR UP? BNE O7 ;OK. INC Y ;TOO FAR! O7 LDA Y CMP #200 ;TOO FAR DOWN? BNE O8 ;OK. DEC Y ;TOO FAR! ; Put astronaut on playfield O8 LDA X ;GO AHEAD AND SET... STA HPOSP0 ;HOR. POSITION LDX #$00 ;NOW COPY THE... LDY Y ;ASTRONAUT IMAGE... B1 LDA ANAUT,X ;INTO PLAYER 1 STA (PBASE),Y INX INY CPX #19 BNE B1 ; Move missiles LDX #$00 D0 LDA DM,X ;GET MISSILE DIR. BNE D1 INC XM,X ;RIGHT... DEC YM,X ;AND UP D1 LDA DM,X CMP #1 BNE D2 INC XM,X ;RIGHT... INC YM,X ;AND DOWN! D2 LDA DM,X CMP #2 BNE D3 DEC XM,X ;LEFT... INC YM,X ;AND DOWN! D3 LDA DM,X CMP #3 BNE DO1 DEC XM,X ;LEFT... DEC YM,X ;AND UP! DO1 INX ;NEXT MISSILE CPX #6 ;ALL DONE? BNE D0 ;NO, DO OTHERS! ; Check if missile has hit wall LDX #$00 C0 LDA XM,X ;GET X POS. CMP #202 ;TOO FAR RIGHT? BNE C1 ;IT'S OK. LDA DM,X ;IT'S TOO FAR, BNE DI1 ;WE MUST REVERSE LDA #3 ;THE DIRECTION! STA DM,X CLC BCC C1 DI1 LDA #2 STA DM,X C1 LDA XM,X ;GET X POS. CMP #48 ;TOO FAR LEFT? BNE C2 ;OK. LDA DM,X ;REVERSE DIRECTION! CMP #2 BEQ DI2 LDA #0 STA DM,X CLC BCC C2 DI2 LDA #1 STA DM,X C2 LDA YM,X ;GET Y POS. CMP #52 ;TOO FAR UP? BNE C3 ;OK. LDA DM,X ;REVERSE! BNE DI3 LDA #1 STA DM,X CLC BCC C3 DI3 LDA #2 STA DM,X C3 LDA YM,X ;GET Y POS. CMP #213 ;TOO FAR DOWN? BNE C4 ;OK. LDA DM,X ;REVERSE! CMP #1 BNE DY2 LDA #$00 STA DM,X CLC BCC C4 DY2 LDA #3 STA DM,X C4 INX ;NEXT MISSILE CPX #6 ;ALL DONE? BNE C0 ;NO, DO OTHERS! ; Plot missiles on playfield LDA XM ;SET ALL MISSILES... STA HPOSP1 ;HORIZONTAL... LDA XM+1 ;POSITIONS! STA HPOSP2 LDA XM+2 STA HPOSP3 LDA XM+3 STA HPOSM1 LDA XM+4 STA HPOSM2 LDA XM+5 STA HPOSM3 LDA #$00 ;PLOT 1ST MISSILE LDY YM ;IN PLAYER 1 STA (BASE2),Y LDA #$10 INY STA (BASE2),Y INY STA (BASE2),Y LDA #$00 INY STA (BASE2),Y LDA #$00 ;PLOT 2ND MISSILE LDY YM+1 ;IN PLAYER 2 STA (BASE3),Y LDA #$10 INY STA (BASE3),Y INY STA (BASE3),Y LDA #$00 INY STA (BASE3),Y LDA #$00 ;PLOT 3RD MISSILE LDY YM+2 ;IN PLAYER 3 STA (BASE4),Y LDA #$10 INY STA (BASE4),Y INY STA (BASE4),Y LDA #$00 INY STA (BASE4),Y LDA #$EF ;PLOT 4TH MISSILE LDY YM+3 ;IN MISSILE 1 AND (MBASE),Y STA (MBASE),Y LDA #$10 INY ORA (MBASE),Y STA (MBASE),Y LDA #$10 INY ORA (MBASE),Y STA (MBASE),Y LDA #$EF ;PLOT 5TH MISILE INY ;IN MISSILE 2 AND (MBASE),Y STA (MBASE),Y LDA #$FB LDY YM+4 AND (MBASE),Y STA (MBASE),Y LDA #$04 INY ORA (MBASE),Y STA (MBASE),Y LDA #$04 INY ORA (MBASE),Y STA (MBASE),Y LDA #$FB ;PLOT 6TH MISSILE INY ;IN MISSILE 3 AND (MBASE),Y STA (MBASE),Y LDA #$BF LDY YM+5 AND (MBASE),Y STA (MBASE),Y LDA #$40 INY ORA (MBASE),Y STA (MBASE),Y LDA #$40 INY ORA (MBASE),Y STA (MBASE),Y LDA #$BF INY AND (MBASE),Y STA (MBASE),Y ; Create sound INC T1 LDA T1 CMP #$10 BNE SO1 LDA #$00 STA T1 DEC T2 LDA T2 BNE SO2 LDA #3 STA T2 SO2 LDA #$C8 ;SET SOUND CONTROL STA AUDC2 LDA T2 ;GET SOUND NUMBER CMP #3 ;SOUND 3? BNE S2 ;NO! LDA #120 ;SET 3RD... STA AUDF2 ;SOUND FREQUENCY CLC BCC SO1 ;GO SHOW TIME S2 LDA T2 CMP #2 ;SOUND 2? BNE S3 ;NO! LDA #100 ;SET 2ND... STA AUDF2 ;SOUND FREQUENCY CLC BCC SO1 ;AND SHOW TIME S3 LDA #85 ;SET 1ST STA AUDF2 ;SOUND FREQUENCY SO1 LDA TI1 ;SHOW DIGIT 1... STA SCREEN+9 ;OF SECONDS LDA TI2 ;SHOW DIGIT 2... STA SCREEN+10 ;OF SECONDS LDA TI4 ;SHOW MINUTES! STA SCREEN+7 ; Check for extra life LDA TI4 ;GET MINUTES CMP #19 ;3 MINUTES? BNE OELC ;NO! LDA ELF ;DONE EXTRA LIFE YET? BNE OELC ;YES, NO MORE! INC LIFE ;ANOTHER LIFE INC ELF ;SET EXTRA LIFE FLAG LDA #$A4 ;SET UP FOR... STA AUDC1 ;EXTRA LIFE SOUND LDA #$01 STA SF1 OELC LDA TI4 ;GET MINUTES CMP #21 ;5 MINUTES? BNE OEL ;NO! LDA ELF ;GOT 2ND EXTRA? CMP #1 BNE OEL ;NO MORE! INC LIFE ;ANOTHER LIFE! INC ELF ;INC EXTRA LIFE FLAG LDA #$A4 ;SET UP FOR... STA AUDC1 ;EXTRA LIFE SOUND LDA #$01 STA SF1 ; Check for ending sequence OEL LDA HIT ;ASTRO HIT DEBRIS? BEQ NEND ;NO, HE'S OK. JMP END ;UH-OH! NEND LDA #80 ;THIS SECTION LSR TI1 ;CREATES A TIME PHP ;DELAY USING SEC ;THE TIME VARIABLES SBC TI1 ;TI1 AND TI4 PLP ROL TI1 LDX #$00 SMOR SBC TI4 INX CPX #3 BNE SMOR TAX TD1 LDY #$00 ;THIS IS A TD2 INY ;TIME DELAY BNE TD2 ;ROUTINE! DEX BNE TD1 ; Play extra life sound LDA SF1 ;GET BONUS SOUND FLAG CMP #1 ;FIRST FREQ? BNE SC2 ;NO! LDA #50 ;SET 1ST BONUS FREQ. STA AUDF1 INC STIME ;INC SOUND TIMER LDA STIME CMP #$25 ;END OF SOUND? BNE SC2 ;NOT YET! INC SF1 ;NEXT FREQ LDA #$00 ;NO MORE SOUND! STA STIME SC2 LDA SF1 ;GET BONUS SOUND FLAG CMP #2 ;SECOND FREQ? BNE SC3 ;NO! LDA #40 ;SET FREQ. STA AUDF1 INC STIME ;INCREMENT TIMER LDA STIME CMP #$25 ;SOUND DONE? BNE SC3 ;NO! INC SF1 ;NEXT FREQ LDA #$00 ;ALL DONE! STA STIME SC3 LDA SF1 ;GET BONUS SOUND FLAG CMP #3 ;3RD FREQ? BNE SC4 ;NO! LDA #32 ;SET FREQ. STA AUDF1 INC STIME ;INC SOUND TIMER LDA STIME CMP #$25 ;SOUND DONE? BNE SC4 ;NO! INC SF1 ;SET FOR END LDA #$00 ;ALL DONE! STA STIME SC4 LDA SF1 ;GET BONUS SOUND FLAG CMP #4 ;END OF SOUND? BNE SC5 ;NO! LDA #00 ;SHUT OFF SOUND! STA AUDF1 STA AUDC1 LDA #$00 ;ALL DONE! STA STIME SC5 LDA #138 ;UPDATE LIVES... LDX #$00 ;DISPLAY DMORE STA SCREEN+13,X ;ALL LIVES INX CPX LIFE BNE DMORE JMP BACK END DEC LIFE ;1 LESS LIFE LDA #$A8 ;INIT DEATH SOUND STA AUDC1 STA AUDC2 LDA #50 ;INIT FREQ. SA STA AUDF1 PHA CLC ADC #100 ;INCREMENT SOUND STA AUDF2 STA PCOLR0 ;FLASH ASTRONAUT PLA LDY #$00 ;TIME DELAY DLY2 LDX #$00 DLY1 INX BNE DLY1 INY CPY #25 BNE DLY2 CLC ADC #$01 CMP #100 ;END OF DEATH? BNE SA ;NO, LOOP BACK LDA #$00 ;SHUT OFF SOUND STA AUDF1 STA AUDC1 STA AUDF2 STA AUDC2 LDA #$46 ;RESET... STA PCOLR0 ;ASTRONAUT COLOR LDA #$00 ;REMOVE... LDY LIFE ;LIFE INDICATOR... STA SCREEN+13,Y ;FROM SCREEN LDA LIFE ;ANY MORE LIVES? BEQ DEATH ;NO! END OF GAME! JMP START ;ANOTHER LIFE. DEATH LDA #00 ;ZERO LIVES STA LIFE AGAIN LDA STRIG0 ;STICK TRIGGER PRESSED? BEQ RESTRT ;YES! LDA CONSOL ;GET CONSOLE KEY CMP #6 ;START PRESSED? BNE AGAIN ;NO! RESTRT LDA #$00 ;RESET... STA ATTRAC ;ATTRACT MODE JMP START2 ;RESTART GAME. ; Vertical blank interrupt VBI LDA M1PL ;GET... ORA M2PL ;ALL... ORA M3PL ;COLLISION... ORA P1PL ;REGISTERS... ORA P2PL ;AND CHECK... ORA P3PL ;FOR... AND #1 ;ASTRONAUT... STA HIT ;COLLISION! INC TI3 ;INCREMENT 1/60 SEC. LDA TI3 ;TIMER CMP #60 ;ANOTHER SECOND? BNE TOVR ;NO! LDA #$00 ;RESET 60THS OF SEC STA TI3 INC TI2 ;ANOTHER SECOND LDA TI2 CMP #26 ;10 SECS? BNE TOVR ;NO! LDA #16 ;RESET 2ND SECOND... STA TI2 ;DIGIT TO 0 INC TI1 ;INCREMENT 1ST... LDA TI1 ;SECOND DIGIT CMP #22 ;GOT A MINUTE? BNE TOVR ;NO! INC TI4 ;INCREMENT MINUTES LDA #16 ;RESET 1ST SECOND... STA TI1 ;DIGIT TO 0 TOVR JMP XITVBV ;EXIT VERT BLANK! ; Set up display list DLIST DB 112,112,112,71 DW SCREEN DB 9,9,9,9,9,9,9,9,9,9 DB 9,9,9,9,9,9,9,9,9,9 DB 9,9,9,9,9,9,9,9,9,9 DB 9,9,9,9,9,9,9,9,9,9 DB 9,9,9,9 DB 65 DW DLIST ; Data for astronaut image ANAUT DB $00,$7C,$54,$6C,$7C,$44,$7C,$10,$10,$FE,$BA,$BA DB $BA,$38,$38,$28,$28,$EE,$00 ; Set up screen memory MIDBYT DB 128,0,0,0,0,0,0,0,0,1 SCREEN DB 0,0,116,105,109,101,0,0,26,0,0,0,0,0,0,0,0,0,0,0 SCRNA DS 10 SCRNB DS 420 SCRNC DS 10 END SSTAR