þþš X;X; ************************X; ** INTERRUPT ROUTINES **(X; ************************2X;<X; -------------FX; VBI ROUTINEPX; -------------ZX;dƒVBIQ>;;Turn off soundn P…AUDC1xX;‚X; DISK FLIPPINGŒX; -------------–X; Q†RTCLOK;;Only flip everyªM>;; other pass´ F‡FLIPTIM¾ !‡FLIPDONÈ%‡FLIPTIM$‡LASTDSK;;If no disks areÒI†DOFLPS;; in Q, skipÜ !‡FLIPDONæ†DOFLPS$>;;For each disk:ðX;ú!‡FLIPLOPQ…DELAY9;;If no delay,F†DOFLIP;; go flip it"…DELAY9;;Update delayH†CKDPFS;;If we've hit"Q…DIREC9;; 0, reverse,N>ÿ;; the flip6,;; direction@O>J P…DIREC9T†CKDPFSQ†IMGNUM9;;If not in^F‡DONXDSK;; flip alreadyhR> ;; go do nextrH†DOFLIP;; disk|‡DONXDSK!‡NXTDISK††DOFLIPQ†IMGNUM9;;Update the,;; image numberš O…DIREC9¤ P†IMGNUM9®Q„LOCL9;;And set the³P‡VBIPNTR;; new disk¸,;; image onÂO>4‡FRSTDSK;; screenÌP†SCRPTR;; (keep baseÖQ„LOCH9;; addr to findÛP‡VBIPNTR;; map index)àO>5‡FRSTDSKêP†SCRPTRô Q†IMGNUM9þT?T?X; CLC O>‡FRSTIMG&%>0P@†SCRPTR7;;Set char 1:3DO>NP@†SCRPTR7;;Set char 2X5bClO>'v?€7ŠO>”P@†SCRPTR7;;Set char 3ž3¨O>²P@†SCRPTR7;;Set char 4¼X;ÆQ‡TTLFLAG;;If on titleÐH‡FCHKDON;; screen orÚ%…DIREC9;; the diskä3;; hasn't justîQ†IMGNUM9;; hit a half-øR†CHMAPI8;; way pointH‡FCHKDON;; skip this  ‡ADR2NDX;;Calc map ?;; index QƒMAP8;;Get old*&‡VBITEMP;; color4>;;Update old>"†SCRPND9;; scoreHN>;;Set newRPƒMAP8;; color\>;;Update newf#†SCRPND9;; scorep $‡VBITEMPzX;„!‡FCHKDONQ†IMGNUM9;;If the diskŽF‡FLPFNSH;; isn't at an˜R> ;; end point¢H‡NXTDISK;; do next disk¬"‡FLPFNSHQ‡TTLFLAG;;If on titles¶H‡REQUEUE;; go queue diskÀ%‡LASTDSK;;Else, moveÊQ…DELAY8;; last diskÔP…DELAY9;; in Q overÞQ†IMGNUM8;; finishedèP†IMGNUM9;; diskò Q„LOCL8ü P„LOCL9 Q„LOCH8 P„LOCH9 Q…DIREC8$ P…DIREC9."‡LASTDSK;;Update last #8#…SSTAT;;Set soundB!‡CHKFOVR;;Do next diskL‡REQUEUEQ>;;On titles -VP…DELAY9;; re-set delay`X;j‡NXTDISK2;;Update disk #t"‡CHKFOVRQ‡LASTDSK;;If there are~G‡FLIPDON;; any moreˆA;; disks to’,;; flip, goœS‡LASTDSK;; and do them¦ E‡FLIPDON° !‡FLIPLOPºX;Ä ‡FLIPDONQ…SSTAT;;Set sound byÎT?;; # of disksØR>;; that finishedâD‡STSOUND;; flippingìQ>ö‡STSOUNDP…AUDC1Q>  P…AUDF1Q> P…SSTAT(X;2X; MOVE PLAYER INDICATORS<X; ----------------------FX;PQ‡TTLFLAG;;If on titlesZF‡MOVEIND;; just go drawd!‡DRAWIND;; themn%‡MOVEIND$†ACTIVE;;For each player:xX;‚#‡MOVELOP%†PORTNO9;;If 'puter, goŒG†MOVCMP;; do 'puter move–X; X; HUMAN MOVEªX;´Q†STRIG08;;If the trigger¾H‡CHKSTIK;; is pressedÈP†ATRACT;; clear attractÒQ†STATUS9;; mode and setÜL>‡TRIGGER;; trigger flagæ P†STATUS9ð#‡CHKSTIKQ†STICK08;;Get the stickúM>N>P‡VBITEMP;; & save itQ>„MINX;;If player is"R…PLYRX9;; too far left,D‡MHCKXHI;; then mask6Q‡VBITEMP;; off left@M>„LEFT ;; move bitJ P‡VBITEMPT!‡MHCKXHIQ…PLYRX9;;If player is^R>„MAXX;; too far righthD‡MHCKYLO;; then maskrQ‡VBITEMP;; off right|M>…RIGHT ;; move bit† P‡VBITEMP ‡MHCKYLOQ>„MINY;;If player isšR…PLYRY9;; too far up¤D‡MHCKYHI;; then mask®Q‡VBITEMP;; off up¸M>‚UP ;; move bit P‡VBITEMPÌ!‡MHCKYHIQ…PLYRY9;;If player isÖR>„MAXY;; too far downàD‡DOHUMOV;; then maskêQ‡VBITEMP;; off downôM>„DOWN ;; move bitþ P‡VBITEMP ‡DOHUMOV †DOMOVE;;Do the move!‡MOVNIND;;& do next plyrX;&X;COMPUTER MOVE0X;:!†MOVCMP#†MOVCLK9;;See if it isD%‡CMPLEVL9;; time to moveNQ‡LVLSPED8;;LVLSPED:XR†MOVCLK9;; 1 NEVER movesbH‡DCMPTRK;; 2 moves 1/2lQ>;; 3 moves 2/3vP†MOVCLK9;; and so on/4€F‡MOVNIND;;If it's time,Š!‡DCMPTRK ‡TRACKIT;; go do move”X;ž‡MOVNIND0;;Move next¨G‡DRAWIND;; player (if²!‡MOVELOP;; any)¼X;ÆX; DRAW PLAYERSÐX; ------------ÚX;ä#‡DRAWIND$†ACTIVE;;For each plyr:îA;;Calculate PMø,;; base for thisO>5‡MISSLES;; player P‡VBIPNTRQ>  P‡VBIPNTR*‡DRPLRLPQ…PLYRX9;;Set X-pos4(>;;If player #0>H†SPLPLX;; we've gotH?;; to set eachR'†HPOSM3;; of the\3;; missilef3;; positionsp '†HPOSM2z3„3Ž '†HPOSM1˜3¢3¬ '†HPOSM0¶ H†DOERPLÀ#†SPLPLXP†HPOSP09;;Else just 1Ê#†DOERPL%†OPLYRY9;;Erase old plyrÔQ>;; imageÞ &‡VBITEMPè$>ò†ERPLRLP@‡VBIPNTR7ü3 0 I†ERPLRL $‡VBITEMP;;Copy new$ %…PLYRY9;; position. '†OPLYRY9;; to old8 $>;;Set playerB ‡DRWAPLRQ‡PLYRSHP9;; at newL P@‡VBIPNTR7;; positionV 3` 0j I‡DRWAPLRt "‡VBIPNTR~ X;ˆ $‡VBITEMP;;Do next’ 0;; (if any)œ I‡DRPLRLP¦ X;° X; EXIT VBIº X; --------Ä X;Î !†XITVBVØ X;â X;ì X; ---------------ö X; VBI SUBROUTINES X; --------------- X; X; COMPUTE MAP INDEX X; GIVEN SCREEN ADDRESS( X;2 ‡ADR2NDXQ>;;Init remainder< P‡VBITEMP;; to zeroF %>; ;This is anotherP $‡DIV80LPT‡VBIPNTR;; standard 6502Z U‡VBIPNTR;; divide & modd U‡VBITEMP;; routine. Thisn Q‡VBITEMP;; one dividesx ;;; VBIPNTR by 80.‚ S>P;; The remainderŒ D…D80L1;; is placed in– P‡VBITEMP;; VBITEMP and the  #‡VBIPNTR;; quotient inª …D80L11;; VBIPNTR´ H‡DIV80LP¾ X;È Q‡VBIPNTR;;Multiply YÒ T?;; by 9Ü T?æ T?ð V‡VBITEMP;;Multiply Xú ,;; by 2 O‡VBIPNTR;;And add them &X; CLC ; together O‡VBITEMP;; (along with" 'X; CLC ; the start, O> ;; border) to6 :;; get index@ X;J X;T X; TRACK-IT: COMP MOVE^ X; Moves in the generalh X; direction of the targetr X; Player number in X| X;† ‡TRACKITQ>;;Clear dir P‡VBITEMPš Q…PLYRX9;;Set DX to¤ ;;; absolute® S…TARGX9;; value of¸ I…SETDX;; playerX - N>ÿ;; targetXÌ ,Ö O>à …SETDXP‚DXê Q…PLYRY9;;Set DY toô ;;; absoluteþ S…TARGY9;; value of I…SETDY;; playerY - N>ÿ;; targetY ,& O>0 …SETDYP‚DY: X;D R‚DX;;If DY >= DXN E†TRACKV;; track VertX  ‡TRKSXDR;;Set X dirb Q>;;Clear partiall P…PARTX9;; X movev Q‚DY;;If DY=0, go€ F‡TRKDOMV;; do moveŠ ;;;Else, add” S‚DX;; DY-DX tož ,;; partial Y¨ O…PARTY9;; move² P…PARTY9¼ D‡TRKDOMV;;If >= 256,Æ  ‡TRKSYDR;; set Y dirÐ !‡TRKDOMV;;Go do moveÚ X;ä †TRACKVQ‚DY;;If DY=0, noî F‡TRKDONE;; moveø  ‡TRKSYDR;;Set Y dir Q>;;Clear partial P…PARTY9;; Y move Q‚DX;;If DX=0, go F‡TRKDOMV;; do move* ;;;Else, if4 S‚DY;; DX=DY do> F†TRACKD;; diagonalH ,;;Else, add DX-R O…PARTX9;; DY to partial\ P…PARTX9;; X move,f D‡TRKDOMV;; if >= 256,p †TRACKD ‡TRKSXDR;; set X dirz X;„ ‡TRKDOMV †DOMOVE;;Do the moveŽ ‡TRKDONE:;; and return˜ X;¢ X; Set X dir¬ X;¶ !‡TRKSXDR%>…RIGHT;;If targetX >À Q…TARGX9;; playerXÊ R…PLYRX9;; set directionÔ E‡TRKXMDR;; for rightÞ %>„LEFT;;Else, setè ‡TRKXMDRC;; it for leftò L‡VBITEMPü P‡VBITEMP:X;X; Set Y dir$X;. ‡TRKSYDR%>„DOWN;;If targetY >8Q…TARGY9;; player YBR…PLYRY9;; set directionLE‡TRKYMDR;; for downV%>‚UP;;Else set`‡TRKYMDRC;; it for upj L‡VBITEMPt P‡VBITEMP~:ˆX;’X;œ X; DO MOVE¦X; Direction in VBITEMP°X; Player number in XºX;Ä#†DOMOVEQ‡VBITEMP;;Get dir & maskÎM>;; off Y dirØF†DOXMVE;;If none, do XâT?;;Calc amountìS>;; to add to ö T?;; Y-pos, O…PLYRY9;;And add it P…PLYRY9#†DOXMVEQ‡VBITEMP;;Get dir & mask(M> ;; off X dir2F‡MOVDONE;;If none, exit<V?;;Calc amountFS>;; to add toP ,;; X-posZO…PLYRX9;;And add itd P…PLYRX9n ‡MOVDONE:xX;‚X;ŒX; -------------–X; DLI ROUTINE X; -------------ªX;´ƒDLI5;;Save A¾Q†VCOUNT;;If not to 1/2ÈT?;; way pointÒG„DLI2;; set charsetÜQ>5†CHRSET;; to mineæ H„DLI3ð!„DLI2Q>5‡ROMFONT;;Else, set itú„DLI3P…WSYNC;; to the ROMP†CHRBAS;; font7;;Restore A9