; ; 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 ;POINT TO... STA ADDR+1 ;MIDDLE OF SCREEN LDA DLIST ;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 ;OUR VERTICAL BLANK... LDY