LIST -L ; D:TRACER ; A ONE OR TWO PLAYER LIGHT CYCLE TYPE GAME ;equates IOCB3 = $30 WRITE = $08 OPEN = $03 MODE = $07 STRPAD = $9A ;indirect addr of info strip ; linkage equates to one player ; module which loads in at $1900 SHPCTL = $4200 PDLSTL = $600 ;mode 7 dlst addr PDLSTH = $601 DIFRTE = $602 ;difficulty increase rate BONUS = $603 ;bonus level RANGE = $604 ;range of ranger ; Title screen display list TTLDL = $5300 ;title screen dlst addr or $2b00 ORG TTLDL ;or 5300 ; LOC TTLDL DB $70,$70,$70,$47,LOW[TTLSCN],HIGH[TTLSCN] DB 7,7,7,7,6,6,6,6,6,$70,$70,2,$70,2,$41,LOW[TTLDL],HIGH[TTLDL] ; Title screen RAM start point TTLSCN DB 0 ; Player/Missle ram area ORG $3000 ; LOC $800 PBASE DS $180 GRM03 DS $80 GRP0 DS $80 GRP1 DS $80 GRP2 DS $80 GRP3 DS $80 DB 0 DB 63 ;number of sectors to load DW $0C00 ;load starting address DW PGMINT ;program initilize addr PREINI LDA #LOW [TTLDL+$100] STA MEMLO STA APPMHI LDA #HIGH [TTLDL+$100] STA MEMLO+1 STA APPMHI+1 LDA #LOW START STA DOSVEC LDA #HIGH START STA DOSVEC+1 CLC PGMINT RTS DEVICE DB 'S:',$9B ; COLOR TABLE ; PM0,PM1,PM2,PM3,PF0,PF1,PF2,PF3,PF4 COLTBL DB 116,116,52,52,8,116,52,0,0 PLROW DB 0,0 PLCOL DB 0,0 ; Starting Position data. Horiz,vert db's ; set P/M starting points ; Row Col db's set plot starting positions PL1VRT DB 58,58,26,55 PL2VRT DB 58,58,90,61 PL1HRZ DB 54,129,60,60 PL2HRZ DB 194,119,188,60 PL1RW DB 46,46,14,43 PL2RW DB 46,46,78,49 PL1COL DB 10,85,16,16 PL2COL DB 150,75,144,16 RNDX DB 0 ;holds rndm start value TTLPRT MACRO LENGTH,TABLE,OFFSET LDX #%1 ?%K LDA %2,X STA [TTLSCN + %3],X DEX BPL ?%K ENDM START = * JSR PREINI JSR INITSN JSR ZHPOS ; Execute main control between one ; and two player games MAIN PROC LDA CONSOL CMP #3 BNE :OVER1 ;if option pressed JSR TGLPLY ; Toggle player 1/2 JSR TACSND ; alter conf snd LDY #20 JSR PAUSE :OVER1 CMP #5 BNE :OVER2 ;if select pressed LDY PLYRC ;check plyr 1 or 2 mode BNE :SKIP JSR TGLRND ;Toggle rounds JMP :END :SKIP JSR TGLDIF ;toggle difficulty :END JSR TACSND LDY #20 JSR PAUSE LDA #0 ;clear accum. :OVER2 CMP #6 BNE :OVER3 ;if start pressed LDA PLYRC ;& plyrc = 1 BNE :ONE ;to plyr 1 ship cntrl JSR TACSND ;else plyr 2 rnd cntrl JSR RNDCTL JMP MAIN :ONE JSR TACSND JSR SHPCTL JMP MAIN :OVER3 LDY PLYRC BNE :OVER4 JSR TGLSPD JMP MAIN :OVER4 JSR TGLBNS JMP MAIN ; end of main game control ; ; ***** Toggle number of players ****** ; This procedure toggles between a ; one or a two player game ; altering the title screen accordingly PLYRC DB 1 ;holds current player option ; Screen data for title screen TRCTBL DB $34,$32,$21,$23,$25,$32 ; TRACER ONETBL DB $2F,$2E,$25,$00,$30,$2C,$21,$39,$25,$32 ; ONE PLAYER TWOTBL DB $34,$37,$2F ; TWO SPDTBL DB $11,$00,$33,$30,$25,$25,$24 ; 1 SPEED RNDTBL DB $11,$10,$00,$32,$2F,$35,$2E,$24,$33 ; 10 ROUNDS CRTBL DB 35,111,112,121,114,105,103,104,116,0,17,25,24,19 NMETBL DB 52,0,111,0,109,0,0,0,55,0,101,0,108,0,108,0,115 DIFTBL DB $24,$29,$26,$26,$29,$23,$35,$2C,$34,$39 ;DIFFICULTY INTTBL DB 0,$29,$2E,$34,$25,$2E,$33,$25 ;HARD MODTBL DB $2D,$2F,$24,$25,$32,$21,$34,$25 ;MODERATE ESYTBL DB 0,0,$25,$21,$33,$39,0,0 ;EASY ;4000 BONUS LEVEL BLVTBL DB $14,$10,$10,$10,0,$22,$2F,$2E,$35,$33,0,$2C,$25,$36,$25,$2C TGLPLY PROC LDA PLYRC ;If one player BNE SWTWO ;switch to two SWONE LDA #1 ;else 2 to 1 STA PLYRC LDX #100 LDA #0 :NEXT2 STA [TTLSCN+100],X DEX BNE :NEXT2 TTLPRT 9,ONETBL,105 TTLPRT 9,DIFTBL,149 TTLPRT 7,ESYTBL,140 TTLPRT 15,BLVTBL,182 LDA #7 ;set difficulty rate STA DIFRTE LDA #15 STA RANGE LDA #$40 ;set bonus level STA BONUS RTS SWTWO = * LDA #0 ;set PLYRC w/ two player code STA PLYRC LDX #80 LDA #0 :NEXT3 STA [TTLSCN+120],X DEX BNE :NEXT3 TTLPRT 2,TWOTBL,105 TTLPRT 6,SPDTBL,146 LDA #SLOWSP ;set delay loop reg STA DELAY ; w/ slow speed TTLPRT 8,RNDTBL,185 LDA #10 ;set rounds counter (BCD) STA RNDS RTS ; ****** Toggle rounds ****** ; This PROC toggles the round choices ; and update the title screen RNDS DB 0 TGLRND PROC LDA RNDS CMP #40 ;if 40 BEQ :SET10 ;change to 10 (BCD) ASL A ;else mult by two STA RNDS JMP PRTRND :SET10 LDA #10 STA RNDS LDA #$11 STA [TTLSCN+185] RTS PRTRND = * CMP #20 BNE PRT40 LDA #$12 STA [TTLSCN+185] RTS PRT40 LDA #$14 STA [TTLSCN+185] RTS ; Speed control toggle KEYTBL DB $1F,$1E,$1A,$18,$1D,$1B,$33,$35,$30 DTBL DB SLOWSP,INTMSP,FASTSP DELAY DB 0 TGLSPD PROC LDA CH LDX #2 :NEXT CMP KEYTBL,X ;find kbcode val BEQ :FOUND DEX BPL :NEXT RTS ;can't find :FOUND LDA DTBL,X ;set delay from table STA DELAY INX ! TXA ! CLC ADC #$10 ;put proper number STA [TTLSCN+146] ;on screen LDA #$FF STA CH JSR TACSND RTS ; toggle bonus levels TGLBNS PROC LDA CH LDX #8 :NEXT CMP KEYTBL,X ;find kbcode val BEQ :FOUND DEX BPL :NEXT RTS ;can't find :FOUND INX ! TXA ASL A ! ASL A ! ASL A ! ASL A STA BONUS TXA ! CLC ADC #$10 ;put proper number STA [TTLSCN+182] ;on screen LDA #$FF STA CH JSR TACSND RTS ; toggle difficulty CRGTBL DB 25,40,15 ;complement range values DFCTBL DB 7,11,21 ;difficulty table CDFTBL DB 11,21,7 ;complement dfctbl TGLDIF PROC LDX #2 LDA DIFRTE :NEXT CMP DFCTBL,X BEQ :OVER DEX BPL :NEXT :OVER LDA CDFTBL,X STA DIFRTE LDA CRGTBL,X STA RANGE TXA BNE :OVER2 TTLPRT 7,MODTBL,140 RTS :OVER2 CMP #1 BNE :OVER3 TTLPRT 7,INTTBL,140 RTS :OVER3 TTLPRT 7,ESYTBL,140 RTS LINK D:TRCA.ASM