dX;nX; DLI RoutinexX; -----------X;DLIVEC5;;save Acc#CLOCK;;increment clockQRTCLOK;;system clockT?;;times 2M>;;mask colorPPCOLR2;;saucer color7;;restore Acc 9;;returnX;X; Console CheckerX; ---------------X;CONCQCONSOL;;get console?;;to Y registerNCONSAV;;only different"MCONSAV;;pressed keys,'CONSAV;;save current6R>;;OPTION test@ :;;returnJX;TX; Beep Routine^X; ------------hX;rBUZZERPAUDF2;;buzzer freq|Q>;;pure tonePAUDC2;;in tone 2%>;;beep counterBZ0;;decrement XHBZ;;zero yet? No.&ATRACT;;poke attract1;;decrement YHBZ;;tone done? No.'AUDC2;;Yes. turn off :;;returnX;X; Flying Saucer RoutineX; ---------------------X;DELAY$>;;get zeroQ>;;pure tonePAUDC1;;enable tone 1&PAUDC2;;enable tone 20DL1Q>;;1/5 sec count:DL2RCLOCK;;compare clockDHDL2;;match? No.N CONC;;check consoleXHDL3;;OPTION key? No.b7;;Yes. pull RTSl7;;addr from stackv!STOPTS;;options menuDL3Q>;;get zeroPCLOCK;;init clock2;;inc saucer posA;;move to AccPHPOSP3;;move saucerM>;;window movementPHPOSP2;;do windowsV?;;times 2V?;;times 4V?;;times 8?;;index to displaQPMSG8;;get textPDRAM98;;on screenA;;saucer position T?;;times 2T?;;times 4 T?;;times 8*T?;;times 164T?;;times 32 whew!>N>;;inverse hi bitsHPAUDF1;;saucer soundR,;;clear carry\O>;;weird soundfPAUDF2;;with resonancepA;;saucer positionzHDL1;;off screen? No.PAUDC2;;sound 2 offPVOLUME;;saucer volume :;;returnX;X; Move All P/M Off ScreenX; -----------------------X;CLRPM$>;;8 objects 0-7Q>;;zero positionCPMPHPOSP09;;move P/M0;;decrement countICPM;;done? No. :;;returnX;X; Turn Off All SoundX; ------------------$X;.AUDOFFQ>;;get zero8PAUDC1;;sound 1 offBPAUDC2;;sound 2 offLPAUDC3;;sound 3 offVPAUDC4;;sound 4 off` :;;returnjX;t#X; Program Execution Starts Here~#X; -----------------------------X;RISQ><;;cassette offPPACTL;;poke hardwareQ>4DOT;;density loPSELPNT;;select point loQ>5DOT;;density hiPSELPNT;;select pnt hiQ>;;init soundPAUDCTL;;audio control$>YPLRCONSAVI1PCONSAV9;;zero flags0;;decrement indexII1;;done? No. X;X; System Reset Returns HereX; -------------------------(X;2INTROQ>);;value to enable<PSDMCTL;;narrow playfldFQ>;;value to turnPPSKCTL;;off 2-tome modeZQ>5MRAM;;high byte ofdPPMBASE;;P/M addressnQ>;;value toxPGRACTL;;enable playersQ>4DLIVEC;;DLI addr loPVDSLST;;DLI vector loQ>5DLIVEC;;DLI addr hiPVDSLST;;DLI vector hiQ>;;value toPNMIEN;;enable DLI'sQ>5CHARS;;addr ofPCHBAS;;character setQ>;;value forPCOLOR1;;medium greenQ>;;value forPCOLOR2;;dark blueQ>;;value forPPCOLR3;;dark greyQ>;;value - playerPSIZEP2;;double width"PSIZEP3;;players set,PGPRIOR;;PL has priority6 CLRPM;;remove PLayers@PREVF;;rev screen flagJPDIRSW;;sound directionT AUDOFF;;sound off^>;;zero indexhI2PDRAM9;;clear displayrPDRAM9;;page 2|PDRAM9;;page 3PMRAM9;;player 2+30;;decrement indexHI2;;done? No.$>;;move 8 bytesI3QWINDOW9;;saucer windowsPMRAM(9;;player 2QSAUCER9;;saucer shipPMRAM9;;player 30;;decrement indexII3;;saucer done? No.X;X; Print Text Onto DisplayX; -----------------------X;PTITL2;;increment indexQTITLE9;;get text&FSTITL;;byte zero? Yes.0?;;display index:P22;;inc text indexDQTITLE9;;get textNR>;;EOL flagXFPTITL;;EOL? Yes.bPDRAM8;;on screenl3;;inc displa indxv!P2;;continueX;X; Scroll Text For IntroX; ---------------------X;STITLQ>4DISPI;;DL addr loPSDLSTL;;DL pntr loQ>5DISPI;;DL addr hiPSDLSTL;;DL pntr hiQ>5DRAM;;screen top hiPDADR;;DL LMS hiQ>;;get zeroPDADR;;DL LMS loPATRACT;;poke attractPVOLUME;;clear volume S1Q>;;16/60 sec countS2*CLOCK;;check clock FS2;;time up? No.* CONC;;console keys4HS2A;;OPTION key? No.>!STOPTS;;option menuHS2AQ>;;get zeroRPCLOCK;;reset clock\#SLINE;;inc scroll cntfQSLINE;;scroll countp,;;clear carryzODADR;;screen addr loNDIRSW;;sound directionPAUDF1;;rocket soundQSLINE;;scroll countM>;;use only 0..7O>SMK;;smoke offsetPDRAM;;put below bothPDRAM ;;rocket shipsO>;;botm smk offsetPDRAM;;put below topPDRAM;;smoke of shipsQSLINE;;scroll countR>;;check overflow?HS3;;No. continue Q>;;get zero PSLINE;;reset count PVSCROL;;vertical scroll$ #VOLUME;;raise volume. QDIRSW;;sound direction8 NVOLUME;;EOR with volumeB L>;;rough soundingL PAUDC1;;rocket soundV QDADR;;DL LMS lo` ,;;clear carryj O>;;line widtht PDADR;;new DL LMS lo~ DS3;;overflow? No. #DADR;;inc LMS hi Q>5DRAM;;cmp scrn end RDADR;;with LMS hi HS4;;at end? No. !INTRO;;Yes. do intro S4 DELAY;;flying saucer Q> ;;value for PAUDF1;;reset frequency Q>;;full volume PAUDC1;;reset tone Q>;;reverse sound PDIRSW;;sound direction S3QSLINE;;scroll count PVSCROL;;vertical scroll !S1;;continue X;( X; Game Option Menu Routine2 X; ------------------------< X;F #STOPTSQCLOCK;;allow one VBLANKP STPRCLOCK;;period to go byZ FSTP;;before startd Q>!;;value forn PSDMCTL;;narrow playfldx Q>4DISPO;;DL addr lo PSDLSTL;;displa list lo Q>5DISPO;;DL addr hi PSDLSTL;;displa list hi  SCRCLR;;clr inv Univ  CLRPM;;clear players PATRACT;;poke attract PGRACTL;;no players  AUDOFF;;sound off PFLASHF;;clr flash flag PREVF;;clr inv flag Q>;;color value for PCOLOR2;;medium blue Q>;;five notes 0-4 PTEMP;;same index STS$TEMP;;get index QCE3K9;;get color" PCOLOR1;;change color, QCE3KN9;;get note6  BUZZER;;play note@ "TEMP;;dec indexJ ISTS;;done? No.T ST1QCH;;check keyboard^ M>?;;mask CTRL/SHIFTh $> ;;check for 0-9r !ST1ARNUMMSK9;;cmp keycode| FST1B;;numeric? Yes. 0;;decrement index HST1A;;done? No. FST1C;;Yes. continue ST1BA;;index is number PTRAMN;;store time ,;;clear carry O>N0C;;display offset PTIMOPT;;show time opt A;;number again O>N7C;;2nd char set PTRAMC;;game score line Q>;;clear the PCH;;keyboard buffer A;;number again T?;;times 2 T?;;times 4& N>?;;inverse here to0  BUZZER;;number sound: ST1C CONC;;check consoleD V?;;check START keyN DST2;;START key? No.X !PLAYGM;;Yes. play gameb X;l X; SELECT Key Handlerv X; ------------------ X; ST2V?;;check SELECT DST3;;SELECT key? No. Q>0;;Yes. do SELECT  BUZZER;;key noise $OPTION;;opt to change #TRIG9;;inc option byte QTRIG9;;get option byte MSELMSK9;;mask overflow PTRIG9;;save opt byte LSOFSET;;SELECT offset T?;;times 2 >;;use as X index %>;;zero Y index QMADR9;;text addr lo P@SELPNT7;;LMS byte lo 3;;inc Y index* QMADR9;;text addr hi4 P@SELPNT7;;LMS byte hi> !ST1;;continueH X;R X; OPTION Key Handler\ X; ------------------f X;p ST3V?;;check OPTIONz DST1;;OPTION key? No. Q>;;Yes. do OPTION  BUZZER;;key sound $>;;reset text flag ST4&OPTSW;;option switch QOPTION;;option counter T?;;times 2 T?;;times 4 T?;;times 8 T?;;times 16 >;;use as index %> ;;do 14 bytes ST4AQ>;;get sign bit NOL29;;flip signPOL29;;save byte2;;increment index1;;decrement count$IST4A;;done? No..QOPTSW;;option switch8HST4B;;flipping done?B!ST1;;Yes. continueL!ST4B#OPTION;;inc option cntrVQOPTION;;option counter`T?;;times 2j>;;use as indextQLADR9;;DL LMS addr lo~PSELPNT;;select pntr loQLADR9;;DL LMS addr hiPSELPNT;;select pntr hi$OPTION;;option counterQSELMS29;;offset tableOSOFSET;;present offsetPSOFSET;;new offset$>;;get zeroQOPTION;;option counterR>;;range: 0..4HST4;;overflow? No.&OPTION;;reset counter&SOFSET;;reset offset!ST4;;continue