þþónX;x X; Asteroid Field Initializer‚ X; --------------------------ŒX; Initialize pointers–X; ------------------- X;ª"†LDGRRTQ>4„ASTR;;asteroid right´P†GRPAGE;;field addr lo¾?;;use as indexÈQ>5„ASTR;;asteroid rightÒP†GRPAGE;;field addr hiÜQ>…PAGES;;# of 256 byteæP„TEMP;;blocks to moveð :;;returnúX;#X; Generate Asteroid Field Bytes#X; -----------------------------X;"†RANWRDQ>;;# 4-bit nibbles,P„TEMP;;save counter6…RANW0(†RANDOM;;with density@U„TEMP;;carry to bit 0JT„TEMP;;to bit 1TT„TEMP;;to bit 2^T„TEMP;;to bit 3h"„TEMP;;nibble countrH…RANW0;;byte done? No.|Q„TEMP;;move byte to†P@†GRPAGE7;;graphic area :;;returnšX;¤"X; Fill Workspace With Graphics®"X; ----------------------------¸X;Â!†RANFIL †LDGRRT;;init pointersÌT„TEMP;;blocks times 2Ö$„DENS;;get densityà!…RANF0 †RANWRD;;make starfieldê3;;inc block indexôH…RANF0;;block done? No.þ#†GRPAGE;;inc page pntr"„TEMP;;dec block cntrH…RANF0;;done? No.X;&X; Shift ASTR Space To Right0X; -------------------------:X;D"†GRPAGE;;dec page pntrNQ>…PAGES;;get block countXP„TEMP;;store countb…RANF11;;dec indexlQ@†GRPAGE7;;asteroid bytevV?;;force to odd€P@†GRPAGE7;;replace byteŠC;;exam index”H…RANF1;;index=0? No.ž"†GRPAGE;;back up pntr¨"„TEMP;;decrement count²H…RANF1;;Done? No.¼ :;;returnÆX;ÐX; Ship Scoring RoutineÚX; --------------------äX;î…SCORE%> ;;clr top 16 bytesøƒSC0PƒPM08;;of player 0PƒPM18;;and player 1 1;;decrement indexIƒSC0;;done? No. Q…XSTRT9;;start position*P„XPLR9;;to player pos4P†HPOSP09;;set hardware>†SCOREMA;;save X to AccH5;;push AccRQ…SCPNT9;;score Y pos\>;;use as indexf#„TRAM9;;increment scorepQ„TRAM9;;get score bytezR>ƒN0C ;;value over 9?„DƒSC1;;No. skipŽQ>ƒN0C;;get zero char˜P„TRAM9;;to 1's position¢#„TRAM9;;inc 10's pos¬ƒSC17;;pull Acc¶>;;get X indx backÀQ†SCNOTE9;;score soundÊP…AUDF3;;set frequencyÔQ>®;;loud soundÞP…AUDC3;;set volumeèQ>;;value foròP†SCLOCK;;sound durationü"†SCORES9;;dec max scoreHƒSC2;;from 99 to zeroQ>;;99 points soP†ENDGAM;;end the game$ƒSC2Q>ÿ;;value to return.P†HITCLR;;clear collision8 :;;returnBX;LX; Ship Graphics RotationVX; ----------------------`X;j…ROTORA;;move X to Acct 5;;save X~Q…CLOCK;;get clockˆW?;;test bit 0’EƒRT2;;bit=1? Yes.œ"†ROTATE;;rotation index¦IƒRT1;;rotate<0? No.°Q>;;reset value forºP†ROTATE;;rotation indexăRT1$†ROTATE;;get indexÎQ†ROTMSK9;;spinner graphicØP…SHIPS ;;saucer sectionâM><;;mask for rocketìP…SHIPS;;rocket upperöQ†ROTMSK9;;next seqM><;;mask for rocket P…SHIPS;;rocket lowerQ…CLOCK;;get clock againM>;;missile mask(>;;use as index2Q†MISIMA9;;missile image<P†MIMAGE;;image bufferFQ†MISIMA9;;missile pic+1PP†MIMAGE;;image buffer+1ZƒRT27;;pull Accd>;;restore Xn :;;returnxX;‚X; Countdown Timer HandlerŒX; -----------------------–X; "…TIMER"„TRAM;;1/10 sec timerªIƒTMX;;time up? No.´Q>;;Yes. value to¾P„TRAM;;reset timerÈQ†SCLOCK;;tic sound clockÒFƒRT3;;tic done? Yes.Ü"†SCLOCK;;dec tic clockæ!ƒRT4;;continueðX;úƒRT3P…AUDC3;;tic sound off!ƒRT4"„TRAM ;;1/10 sec displa"„TRAM;;1/10 sec cntrIƒTMX;;1 sec done? No."Q>ƒN7CÉ;;value to reset,P„TRAM ;;1/10 sec displa6Q> ;;value to reset@P„TRAM;;1/10 sec cntrJQ†SCLOCK;;sound clockTHƒRT5;;in use? Yes.^Q>¤;;value forhP…AUDC3;;pure tonerQ>@;;value for|P…AUDF3;;medium freq†ƒRT5"„TRAM ;;one's display"„TRAM;;one's counteršIƒTMX;;10 sec up? No.¤Q>ƒN7CÉ;;value to reset®P„TRAM ;;one's display¸Q> ;;value to resetÂP„TRAM;;one's counterÌ"„TRAM ;;ten's displayÖ"„TRAM;;ten's counteràIƒTMX;;minute up? No.êQ>ƒN7CÅ;;value to resetôP„TRAM ;;ten's displayþQ>;;value to resetP„TRAM;;ten's counter"„TRAM;;minute display"„TRAM;;minute counter&ƒTMX6;;save flags0Q†SCLOCK;;if score sound:L†COUNTR;;or missile 0/1DL†COUNTR;;active?NH„TMXX;;Yes. skip nextXQ„DEAD;;either ship 0bM„DEAD;;or ship 1lF„TMXX;;dead? Yes.vQ†MISSLE;;OR flags for€L†MISSLE;;projectilesŠF„TMXX;;any active? No.”Q>(;;projectile sndžP…AUDC3;;to hardware¨Q…CLOCK;;60 cycle clock²V?;;make 30 cycles¼M>;;only 0..7ÆL>;;8..15ÐP…AUDF3;;boomerang soundÚ„TMXX8;;restore flagsä :;;returnîX;øX; Collision HandlerX; ----------------- X;…SMASHQ„M1PL;;missile 1 to M>;;player 0 ship*H…HITP0;;collision? Yes.4Q„P0PF;;player 0 to>M>;;playfield 2 orHL„P0PL;;to any playerRF„PLR1;;collision? No.\Q…TRIGN;;trigger optionfR>;;shield in use?pF„PLR1;;Yes. ship safez…HITP0Q>;;value for ship„P„DEAD;;being shot downŽ„PLR1Q„M0PL;;missile 0 to˜M>;;player 1 ship¢H…HITP1;;collision? Yes.¬Q„P1PF;;player 1 to¶M>;;playfield 2 orÀL„P1PL;;to any playerÊF„HITX;;collision? No.ÔQ…TRIGN;;trigger optionÞR>;;shield in useèF„HITX;;Yes. ship safeò…HITP1Q>;;value for shipüP„DEAD;;being shot down „HITX:;;return X; X; Space Boomerang Handler$ X; -----------------------. X;8 #†MISFLYQ†MISSLE9;;missile statusB H„HITX;;active? Yes.L Q…TRIGN9;;trigger valueV R>;;shots enabled` F„MISF;;Yes. continuej P…TRIGS9;;put shadowt :;;return~ X;ˆ X; Set up Launch Coordinates’ X; -------------------------œ X;¦ „MISFR…TRIGS9;;compare shadow° F„HITX;;same? Yes.º P…TRIGS9;;put shadowÄ P†MISSLE9;;enable missileÎ ,;;clear carryØ Q„XPLR9;;ship X coordâ O>;;get ship centerì P†OLDCOL;;X plot coordö P†COLCRS9;;shot current X Q„YPLR9;;ship Y coord P†OLDROW;;Y plot coord #†OLDROW;;ship top P†ROWCRS9;;shot current Y( #†ROWCRS9;;plot coord2 A;;player index< F„MIS1;;player 0? Yes.F X;P X; Player 0 is targetZ X; ------------------d X;n Q„XPLR;;enemy X coordx O>;;ship center‚ P†NEWCOL;;destination XŒ Q„YPLR;;enemy Y coord– !„MIS2;;skip next  X;ª X; Player 1 is target´ X; ------------------¾ X;È „MIS1Q„XPLR;;enemy X coordÒ O>;;ship centerÜ P†NEWCOL;;destination Xæ Q„YPLR;;enemy Y coordð „MIS2P†NEWROW;;destination Yú #†NEWROW;;ship top Q>;;init value for P†ROWINC9;;Y increment P†COLINC9;;X increment" ;;;set carry, Q†NEWROW;;Y to coord6 S†OLDROW;;Y from coord@ P†DELTAR9;;delta YJ E„MIS3;;shot down? Yes.T Q>ÿ;;value = -1^ P†ROWINC9;;move uph N†DELTAR9;;get absoluter P†DELTAR9;;value for| #†DELTAR9;;delta Y† „MIS3;;;set carry Q†NEWCOL;;X to coordš S†OLDCOL;;X from coord¤ P†DELTAC9;;delta X® E„MIS4;;to right? Yes.¸ Q>ÿ;;value = -1 P†COLINC9;;move leftÌ N†DELTAC9;;get absoluteÖ P†DELTAC9;;value forà #†DELTAC9;;delta Xê „MIS4Q>;;init value forô P…COLAC9;;X accumulatorþ P…ROWAC9;;Y accumulator Q†DELTAC9;;get delta X P…ENDPT9;;line length Q>;;init value for& P†COUNTR9;;draw iteration0 Q†DELTAR9;;get delta Y: R…ENDPT9;;bigger thanD D„MIS5;;delta X? No.N P…ENDPT9;;store new valueX V?;;delta Y / 2b P…COLAC9;;X coord Accl :;;returnv X;€ „MIS5Q…ENDPT9;;get delta XŠ V?;;divide by 2” P…ROWAC9;;Y coord Accž :;;return