\ ShipWrecked I \ by Dominic Ford 1996-8 \ Commodore 64 Version 1998 * = $5302 @ = 2 .xch EQUB0 .ych EQUB0 .col EQUB0 .score EQUW0 .scrch EQUB0 .titstat EQUB0 .mdir EQUB0 .xset EQUB0 .yset EQUB0 .xscr EQUB0 .yscr EQUB0 .xpos EQUB0 .ypos EQUB0 .mfine EQUB0 .mtype EQUB0 .scrno EQUB0 .upvelo EQUB0 .xold EQUB0 .yold EQUB0 .fine EQUB0 .sound EQUB1 .clock EQUB0 .titcyc EQUB0 .invflag EQUB0 .face EQUB1 .phase EQUB0 .rghts EQUB0 .wiper EQUB0 .movstag EQUB0 .changed EQUB0 .power EQUB0 .powchange EQUB0 .objects EQUW0 .obch EQUB0 .getstat EQUB0 .lastat EQUB0 .lasad EQUW0 .lasdir EQUB0 .lastep EQUB0 .xf EQUB0 .yf EQUB0 .wirep EQUW0 .wirepb EQUW0 .xmont EQUB0 .ymont EQUB0 .mflag EQUB0 .monstat EQUB0 .wiperm EQUB0 .deaded EQUB0 .clearup EQUB0 .xmoo EQUB0 .ymoo EQUB0 .fnst EQUB0 .scrtxt EQUD0 .shoot EQUB0 .delyou LDXxmoo LDYymoo .mcd STXxset STYyset .dark LDY#5 CPYxscr BNEreald DEY CPYyscr BNEreald LDA#$1A CMPobjects BEQreald CMPobjects+1 BEQreald LDA#0 STA$72 JMPblockon+6 .reald JMPblockon * = $5800 @ = $1000 LDA#$FF STAscrtxt+3 SEI LDA#irq STA$315 CLI .prog JSRtitle JSRblascr JSRscroff LDY#0 LDA#3 STA$70 LDA#$30 STA$71 .lines LDA($70),Y ORA#12 STA($70),Y LDA$70 CLC ADC#8 STA$70 LDA$71 ADC#0 STA$71 CMP#$6C BNElines STApowchange STAobch STAscrch LDY#255 STYpower STYobjects STYobjects+1 INY STYscore STYscore+1 .scobarlop LDAsbar,Y CMP#$FF BEQstext JSRoswrch INY JMPscobarlop .stext LDA#1 STAcol LDA#2 STAxch LDA#24 STAych LDA#scort STA$73 JSRstring LDA#13 STAxch INC$72 JSRstring LDA#8 STAxch LDA#28 STAych INC$72 JSRstring .game LDA#0 STAxscr STAyscr LDA#2 STAxpos STAypos LDX#$30 .clrpot STXclrpnt+2 STXclrplp+2 .clrplp LDA$30FE AND#$7F .clrpnt STA$30FE INX CPX#$80 BNEclrpot .newscr JSRscreen .oldscr JSRquitch JSRsboard LDA#0 STAmovstag LDAfine BEQmoveslop STAchanged LDAwiper PHA JSRmainclear PLA STAwiper .moveslop LDAchanged BEQnodyou JSRdispyou .nodyou JSRdispmon JSRwait INCmovstag LDAmovstag CMP#3 BNEmoveslop LDAmfine PHA LDAfine STAfnst LDA#0 STAmovstag STAchanged STAfine STAmfine JSRdispyou JSRdispmon PLA STAmfine JSRwait JSRmainclear .finend JSRlaser JSRdeadedch JSRmonpro JSRgetoput LDAupvelo BEQfallh JSRjumpup LDAxpos STAxset LDAypos STAyset JSRgetblock CMP#10 BNEnofall BEQwatt .fallh LDAxpos STAxset LDAypos STAyset JSRgetblock CMP#8 BEQwatt CMP#10 BEQwatt CMP#14 BEQladder .laddown LDAypos CMP#9 BEQdownscr INCyset JSRgetblock JSRdoorch BCSfalldown AND#$30 BEQfalldown BNEnofall .downscr LDA#0 STAypos INCyscr JMPnewscr .watt JMPzap .ladder JMP ladderb .falldown LDA#5 STAfine INCypos .nofall LDA#>oldscr-1 PHA LDA#jumpn JMPosword .dispshr SEI LDAwiper BEQnowipe LDY#0 .wiplop LDA(wirep),Y STA($78),Y INY CPY#32 BNEwiplop LDA$78 CLC ADC#$80 STA$78 LDA$79 ADC#2 STA$79 LDY#0 .wipeb LDA(wirepb),Y STA($78),Y INY CPY#32 BNEwipeb .nowipe LDA#1 STAwiper LDAxpos ASL A ASL A ASL A ASL A ASL A ASL A STA$70 LDAxpos LSR A LSR A CLC ADC#$35 STA$71 LDAypos CLC ADC$71 STA$71 LDAypos ASL A ASL A CLC ADC$71 STA$71 LDY#0 STY$72 LDA#$1A STA$73 LDXmovstag LDAsequen,X CLC ADCfine TAX LDA$70 CLC ADClowad,X STA$70 LDA$71 ADChighad,X STA$71 LDAmflag BNEmonsadr CPX#0 BEQnophase LDAmovstag CMP#2 BEQnophase LDXphase INX .addph LDA$72 CLC ADC#$80 STA$72 LDA$73 ADC#0 STA$73 DEX BNEaddph LDAphase EOR#1 STAphase JMPnophase .monsadr LDAmonstat EOR#1 STAmonstat ASL A ASL A ASL A ASL A ASL A CLC ADC#$80 STA$72 LDA#$1B STA$73 LDA#1 STAwiperm LDAmtype CMP#2 BNEnotyptr LDA$72 CLC ADC#$80 STA$72 LDA$73 ADC#0 STA$73 .notyptr JMPleface .nophase LDArghts BEQnotrght LDA$70 CLC ADC#32 STA$70 LDA$71 ADC#0 STA$71 .notrght LDAface BNEleface LDA$72 CLC ADC#$20 STA$72 .leface LDA$70 STA$78 LDA$71 STA$79 .ladisp LDA($70),Y STA (wirep), Y ORA($72),Y STA($70),Y INY CPY#32 BNEladisp LDA$72 CLC ADC#$40 STA$72 LDA$73 ADC#0 STA$73 LDA$70 CLC ADC#$80 STA$70 LDA$71 ADC#2 STA$71 LDY#0 .lbdisp LDA($70),Y STA (wirepb), Y ORA($72),Y STA($70),Y INY CPY#32 BNElbdisp CLI RTS .wait LDAclock CMP$80 BNEwait LDAclock ADC#5 STA$80 RTS .jumpup DECupvelo LDAypos BEQupscr SEC SBC#1 STAyset LDAxpos STAxset JSRgetblock JSRdoorch BCSupone AND#$30 BEQupone LDA#0 STAupvelo RTS .upone LDA#6 STAfine DECypos RTS .upscr DECyscr LDA#9 STAypos JMPscreen .screen LDA#0 STAclearup STAlastat STAinvflag JSRscroff LDAxpos STAxold LDAypos STAyold JSRpoint LDA#$FF STAyset .ylop LDA#$FF STAxset INCyset .xlop INCxset JSRdark LDAxset CMP#9 BEQnexty JMPxlop .nexty LDAyset CMP#9 BNEylop JSRsboard JSRnamscr .scron LDA$D011 ORA#$10 STA$D011 LDAclock CLC ADC#4 STA$80 LDA#0 STAwiper STAwiperm LDA#1 STAchanged JMPmonset .ladderb LDA#3 JSRkeybyte BCSfallset LDA#2 JSRkeybyte BCCstable LDA#1 STAupvelo JSRjumpup JMPoldscr .stable JMPnofall .fallset JMPladdown .blockon JSRobjcheck JSRgetblock LDAxset ASL A ASL A ASL A ASL A ASL A ASL A STA$70 LDAxset LSR A LSR A CLC ADC#$35 STA$71 LDAyset CLC ADC$71 STA$71 LDAyset ASL A ASL A CLC ADC$71 STA$71 LDA$72 LSR A LSR A CLC ADC#$20 STA$73 LDA$72 CMP#30 BEQdoorcol LSR A ROR A ROR A AND#$C0 STA$72 LDY#0 .transtop LDA($70),Y AND#$C0 CLC ADC($72),Y STA($70),Y INY CPY#$40 BNEtranstop LDY#0 LDA$72 CLC ADC#$40 STA$72 LDA$70 CLC ADC#$80 STA$70 LDA$71 ADC#2 STA$71 .transbot LDA($70),Y AND#$C0 CLC ADC($72),Y STA($70),Y INY CPY#$40 BNEtransbot RTS .doorcol JMPlocktype .getblock LDA#$30 CLC ADCxscr STA$71 LDAyscr ASL A ASL A ASL A ASL A CLC ADC$71 STAscrno STA$71 LDAyset STA$70 ASL A ASL A ASL A PHA CLC ADC$70 STA$70 PLA ASL A CLC ADC$70 STA$70 LDYxset LDAxdata,Y TAY LDA($70),Y ROL A ROL A ROL A AND#3 STA$72 INY LDA($70),Y LSR A LSR A LSR A LSR A AND#12 CLC ADC$72 STA$72 LDAxset LSR A TAY LDAhbdat,Y TAY LDA($70),Y STA$73 LDAxset AND#1 BNEbit2 LDA$73 ASL A ROL A ROL A JMPfbgot .bit2 LDA$73 ASL A ROL A .fbgot AND#1 ASL A ASL A ASL A ASL A CLC ADC$72 ASL A STA$72 RTS .blascr JSRscroff LDY#0 STY$70 LDA#$30 STA$71 .blanlop LDA($70),Y AND#$C0 STA($70),Y INY BNEblanlop INC$71 LDA$71 CMP#$80 BNEblanlop JMPscron .putch ASL A ASL A ASL A TAX LDA#0 STA$70 LDA#$30 STA$71 LDYxch .xlopc BEQnoxch LDA$70 CLC ADC#$20 STA$70 LDA$71 ADC#0 STA$71 DEY JMPxlopc .noxch LDYych .ylopc BEQnoych LDA$70 CLC ADC#$80 STA$70 LDA$71 ADC#2 STA$71 DEY JMPylopc .noych LDY#0 .sline LDA$C00,X .linelop PHA ASL A ROL A ROL A AND#3 BEQblanch STA$80 LDA#0 .colch CLC ADCcol DEC$80 BNEcolch .blanch STA$80 LDA($70),Y AND#$C0 ORA$80 EORinvflag STA($70),Y TYA CLC ADC#8 TAY CMP#$20 BCSnewlin PLA ASL A ASL A JMPlinelop .newlin AND#7 TAY PLA INY INX CPY#8 BNEsline RTS \Game2B .string LDY#0 LDA($72),Y CMP#$FF BEQstrend JSRputch INCxch LDA$72 CLC ADC#1 STA$72 LDA$73 ADC#0 STA$73 JMPstring .quitch LDA#7 JSRkeybyte BCSquitok .strend RTS .quitok PLA PLA LDA#8 JSRkeybyte BCCzap JMPprog .zap LDAxold STAxpos LDAyold STAypos LDAsound BEQnozaps LDA#7 LDX#zapn JSRosword .nozaps LDA#1 STApowchange LDApower SEC SBC#$28 STApower BEQyoudie BCCyoudie JMPnewscr .youdie JMPkillu .gameover LDA#5 STAxch LDA#16 STAych LDA#1 STAcol LDA#gamdead STA$73 JSRstring LDA#0 PHA .bellop LDAclock CLC ADC#100 STA$80 .belwait LDAclock CMP$80 BNEbelwait LDAsound BEQnobell LDA#7 LDX#over JSRosword .nobell PLA CLC ADC#1 PHA CMP#4 BNEbellop PLA RTS .gamdead EQUB7 EQUB1 EQUB12 EQUB5 EQUB0 EQUB22 EQUB19 EQUB5 EQUB15 EQUB255 .over EQUW1 EQUW -15 EQUW0 EQUW5 .sboard LDApowchange BEQnopower LDX#0 .powlop LDA$7C70,X AND#$C0 ORA#4 STA$7C70,X INX CPXpower BNEpowlop .pownol LDA$7C70,X AND#$C0 STA$7C70,X INX BNEpownol .nopower LDAobch BEQfinobsc LDA#8 STAxch LDA#26 STAych LDAobjects CMP#$20 BCSblankoba TAY JSRdrawop JMPsecondo .blankoba JSRblankob JMPsecondo .blankob LDA#0 JSRputch INCxch LDA#0 JSRputch INCych LDA#0 JSRputch DECxch LDA#0 JMPputch .secondo LDA#10 STAxch LDA#26 STAych LDAobjects+1 CMP#$20 BCSblankobb TAY JSRdrawop JMPfinobsc .blankobb JSRblankob .finobsc LDAscrch BEQnoscr JSRscorb .noscr LDAobch BEQnoobch LDAclock CLC ADC#5 STA$80 .noobch LDA#0 STAobch STApowchange STAscrch RTS .drawop LDAxch LSR A STAxset LDAych SEC SBC#2 LSR A STAyset JSRdrawobj .objecth LDY#0 .oblop LDA$FA0,Y AND#15 STA$F20,Y LDA$FC0,Y AND#15 STA$F40,Y LDA$FE0,Y LSR A LSR A LSR A LSR A AND#15 STA$F60,Y LDA$FE0,Y AND#15 STA$F80,Y INY CPY#32 BNEoblop RTS .objcheck LDY#0 .obclop LDA$F20,Y CMPxset BNEnotthat LDA$F40,Y CMPyset BNEnotthat LDA$F60,Y CMPxscr BNEnotthat LDA$F80,Y CMPyscr BEQ drawobj .notthat INY CPY#32 BNEobclop RTS .drawobj PLA PLA LDAxset ASL A STAxch LDAyset CLC ADC#1 ASL A STAych LDA$F00,Y STAcol TYA CLC ADC#$E0 STA$7F LDA#0 STA$72 LDA#$A STA$73 JSRobjdisp INCxch INC$73 JSRobjdisp INCych LDA#$E STA$73 JSRobjdisp DECxch DEC$73 JSRobjdisp LDY#8 LDA#0 .clearspob STA$BFF,Y DEY BNEclearspob RTS .objdisp LDY$7F LDX#8 .objdlop LDA($72),Y STA$BFF,X TYA SEC SBC#32 TAY DEX BNEobjdlop TXA JMPputch .getoput LDA#4 JSRkeybyte BCSpickup LDA#0 STAgetstat .keyhang RTS .pickup LDAgetstat BNEkeyhang LDAsound BEQnogp LDA#7 LDX#switn JSRosword .nogp LDAobjects+1 CMP#$20 BCSnoputdown TAY LDAxscr STA$F60,Y LDAyscr STA$F80,Y LDAxpos STA$F20,Y LDAypos STA$F40,Y STY$70 JSRpuzz .noputdown LDAobjects STAobjects+1 LDY#0 .obglop LDA$F20,Y CPY$70 BEQnotgot CMPxpos BNEnotgot LDA$F40,Y CMPypos BNEnotgot LDA$F60,Y CMPxscr BNEnotgot LDA$F80,Y CMPyscr BEQgettobj .notgot INY CPY#32 BNEobglop STYobjects JMPnogetob .gettobj CPY#28 BCCnoener LDA#$FF STA$F20,Y STApower STApowchange STAscrch SED LDAscore CLC ADC#5 STAscore LDAscore+1 ADC#0 STAscore+1 CLD LDA#7 LDX#enrup JSRosword LDY#32 STYobjects JMPnogetob .noener STYobjects LDA#$FF STA$F20,Y .nogetob LDAxpos STAxset LDAypos STAyset JSRblockon LDA#0 STAwiper LDA#1 STAchanged STAobch STAgetstat RTS .title JSRblascr JSRobjecth .titlop INCtitstat LDAtitstat AND#7 TAY LDAtitscrs,Y LSR A LSR A LSR A LSR A STAxscr LDAtitscrs,Y AND#$0F STAyscr JSRscreen LDA#$30 STAinvflag LDA#5 STAcol LDA#4 STAxch LDA#5 STAych LDA#name STA$73 JSRstring LDA#3 STAxch LDA#16 STAych LDA#creda STA$73 JSRstring LDA#4 STAxch LDA#18 STAych LDA#credc STA$73 JSRstring LDA#8 STAxch LDA#22 STAych LDA#space STA$73 JSRstring LDAclock SEC SBC#1 STA$80 .soundpr LDA#6 STAxch LDA#26 STAych LDA#sndoff STA$73 LDAsound BEQsoundset LDA#scrtxt STA$73 JMPstring .doorch PHA CMP#30 BNEnodor LDA#6 JSRkeybyte BCCnodor LDAyscr ASL A ASL A ASL A ASL A CLC ADCxscr ADC#$30 JSRadofcol SEC SBC#1 CMPobjects BEQdoor CMPobjects+1 BNEnodor .door PLA SEC RTS .nodor PLA CLC RTS .locktype LSR A ROR A ROR A AND#$C0 STA$72 LDY#0 .transtop2 LDA($70),Y AND#$C0 JSRcolbyt STA($70),Y INY CPY#$40 BNEtranstop2 LDY#0 LDA$72 CLC ADC#$40 STA$72 LDA$70 CLC ADC#$80 STA$70 LDA$71 ADC#2 STA$71 .transbot2 LDA($70),Y AND#$C0 JSRcolbyt STA($70),Y INY CPY#$40 BNEtransbot2 RTS .colbyt PHA LDAscrno JSRadofcol TAX LDAdoorc,X TAX PLA .colblop CLC ADC($72),Y DEX BNEcolblop RTS .adofcol STAreadcll+2 STAreadclh+2 .readcll LDA$10FE LSR A LSR A LSR A LSR A AND#4 STAsmad+1 .readclh LDA$10FF ASL A ROL A ROL A AND#3 CLC .smad ADC#0 RTS .puzz LDA$FA0,Y LSR A LSR A LSR A LSR A CMPxscr BNEnopuzz LDA$FC0,Y LSR A LSR A LSR A LSR A CMPyscr BEQpsolv .nopuzz RTS .psolv LDAsound BEQpuzsnd LDA#7 LDX#puzn JSRosword .puzsnd LDY$70 LDA$700,Y CMP#32 BCSpuswap TAX LDA$F20,Y STA$F20,X LDA$F40,Y STA$F40,X LDA$F60,Y STA$F60,X LDA$F80,Y STA$F80,X .puswap LDA#$78 STA$F20,Y LDA$720,Y CMP#32 BCSpumovo TAX LDA$740,Y AND#15 STA$F40,X LDA$740,Y LSR A LSR A LSR A LSR A STA$F20,X .pumovo LDA$760,Y CMP#$FF BNEpuzbloc .blopcb LDA#1 STAscrch SED LDAscore CLC ADC#$20 STAscore LDAscore+1 ADC#0 STAscore+1 CLD JMPcomplete .puzn EQUW1 EQUW3 EQUW52 EQUW20 .puzbloc LDXxscr STXxch LDXyscr STXych AND#15 STAyscr LDA$760,Y LSR A LSR A LSR A LSR A STAxscr .blolop LDA$780,Y AND#15 STAyset LDA$780,Y LSR A LSR A LSR A LSR A STAxset PHA TYA PHA JSRgetblock PLA TAX PLA PHA TAY LDAxdata,Y TAY LDA$7A0,X AND#3 LSR A ROR A ROR A STAcol LDA($70),Y AND#$3F ORAcol STA($70),Y INY LDA$7A0,X AND#12 ASL A ASL A ASL A ASL A STAcol LDA($70),Y AND#$3F ORAcol STA($70),Y PLA LSR A TAY LDAhbdat,Y TAY LDA$7A0,X AND#16 ASL A ASL A STAcol LDAxset AND#1 BEQsecpuz LDA($70),Y AND#$7F CLC ADCcol ADCcol STA($70),Y JMPfirpuz .secpuz LDA($70),Y AND#$BF CLC ADCcol STA($70),Y .firpuz TXA CLC ADC#$40 TAY CMP#$80 BCSendbloc JMPblolop .endbloc LDAxch STAxscr LDAych STAyscr JMPblopcb .namscr LDY#0 TYA .scrnam STAnamt,Y INY CPY#16 BNEscrnam LDAyscr ASL A ASL A ASL A ASL A CLC ADCxscr TAY LDA$6B0,Y TAX LDA$900,X STAxch LSR A STAcol LDA#8 SEC SBCcol TAY .wrnam LDA$901,X STAnamt,Y INY INX DECxch BNEwrnam LDA#20 STAcol LDX#2 STXxch DEX STXych LDA#namt STA$73 JMPstring * = $6800 @ = $100 .titscrs EQUB$34 EQUB$52 EQUB$42 EQUB$E2 EQUB$51 EQUB$93 EQUB$90 EQUB$E1 .monpd EQUB$02 EQUB$04 EQUB$06 EQUB$08 .jumpn EQUW1 EQUW1 EQUW52 EQUW5 .zapn EQUW1 EQUW2 EQUW52 EQUW10 .switn EQUW1 EQUW3 EQUW52 EQUW2 .scort EQUB16 EQUB3 EQUB22 EQUB15 EQUB5 EQUB255 .powt EQUB14 EQUB22 EQUB20 EQUB5 EQUB15 EQUB255 .obstxt EQUB22 EQUB2 EQUB9 EQUB16 EQUB255 .sequen EQUB0 EQUB14 EQUB28 .lowad EQUB0 EQUB$30 EQUB$D0 EQUB$B0 EQUB$50 EQUB$80 EQUB$80 .highad EQUB0 EQUB0 EQUB$FF EQUB2 EQUB2 EQUB$FD EQUB2 EQUB0 EQUB$20 EQUB$E0 EQUB$A0 EQUB$60 EQUB$80 EQUB$80 EQUB0 EQUB0 EQUB$FF EQUB2 EQUB2 EQUB$FD EQUB2 EQUB0 EQUB$10 EQUB$F0 EQUB$90 EQUB$70 EQUB0 EQUB0 EQUB0 EQUB0 EQUB$FF EQUB2 EQUB2 EQUB0 EQUB0 .xdata EQUB0 EQUB2 EQUB5 EQUB7 EQUB10 EQUB12 EQUB15 EQUB17 EQUB20 EQUB22 .hbdat EQUB4 EQUB9 EQUB14 EQUB19 EQUB24 .doorc EQUB0 EQUB1 EQUB4 EQUB5 EQUB16 EQUB17 EQUB20 EQUB21 .namt EQUS"----------------" EQUB255 .creda EQUB14 EQUB15 EQUB22 EQUB7 EQUB15 EQUB1 EQUB12 EQUB12 EQUB5 EQUB4 EQUB0 EQUB1 EQUB13 EQUB4 EQUB255 .credb EQUB4 EQUB5 EQUB16 EQUB23 EQUB7 EQUB13 EQUB5 EQUB4 EQUB0 EQUB2 EQUB21 EQUB255 .sndon EQUB16 EQUB22 EQUB18 EQUB13 EQUB4 EQUB0 EQUB22 EQUB13 EQUB0 EQUB255 .sndoff EQUB16 EQUB22 EQUB18 EQUB13 EQUB4 EQUB0 EQUB22 EQUB6 EQUB6 EQUB255 .enrup EQUW1 EQUW1 EQUW52 EQUW20 * = $6480 @ = $1C80 .complete CPY#$14 BEQcongu JMPscreen .congu JSRsboard LDA#cmptxt STA$73 LDA#2 STAxch LDA#7 STAych JSRstring LDA#cmptxtb STA$73 LDA#3 STAxch LDA#14 STAych JSRstring .theend JMPtheend .mainclear LDAmtype BEQnoclearm LDAxpos CMPxmoo BNEmci LDAypos CMPymoo BEQmcii .mci LDAclearup BEQnoclearm .mcii LDA#1 STAchanged JSRdelyou LDXxpos LDYypos JSRmcd LDA#0 STAwiper STAwiperm LDXxmont LDYymont JMPmcd .noclearm RTS .dispmon LDAmtype BEQnomonsr LDA$78 PHA LDA$79 PHA LDAfine PHA LDAxpos PHA LDAypos PHA LDAwiper PHA LDAwiperm STAwiper LDAxmont STAxpos LDAymont STAypos LDAmfine STAfine LDA$7A STA$78 LDA$7B STA$79 LDA#$2F STAwirep+1 STAwirepb+1 LDA#$C0 STAwirep LDA#$E0 STAwirepb LDA#1 STAmflag JSRdispshr LDA$78 STA$7A LDA$79 STA$7B PLA STAwiper PLA STAypos PLA STAxpos PLA STAfine PLA STA$79 PLA STA$78 LDA#0 STAmflag .nomonsr RTS .monset LDAyscr ASL A ASL A ASL A ASL A CLC ADCxscr ADC#$30 STA$71 LDY#0 STY$70 INY STYmfine LDY#$FB LDA($70),Y ASL A ROL A ROL A AND#3 TAX LDAmonpd,X STAxmont INY LDA($70),Y ASL A ROL A ROL A AND#3 TAX LDAmonpd,X STAymont INY LDA($70),Y ASL A ROL A ROL A AND#3 STAmtype LDA#$FF STAmdir .lasexit RTS .monpro LDAxmont STAxmoo LDAymont STAymoo LDA#0 STAclearup LDAmtype BEQlasexit CMP#3 BNEnomonstl LDA#0 STAmfine STAmonstat .nomonstl LDAxpos CMPxmont BNEmontch LDAypos CMPymont BNEmontch LDA#1 STAclearup STApowchange LDAfnst BEQmontch LDApower SEC SBC#8 STApower BCSmontche PLA PLA JMPkillu .montche LDAmtype CMP#3 BNEmontch PLA PLA JMPzap .montch JSRmovemst LDAxpos CMPxmont BNElasexit LDAypos CMPymont BNElasexit LDA#1 STAclearup STApowchange LDApower SEC SBC#8 STApower BCSlasexit PLA PLA JMPkillu .laser LDA#6 JSRkeybyte BCClasexit LDAlastat BNElasexit LDAsound BEQnolassd LDA#7 LDX#switn JSRosword .nolassd LDApower STApowchange SEC SBC#4 STApower BCSlasokay .lasdie PLA PLA .killu JSRgameover JMPprog .lasokay LDAxmont CMPxpos BNEnotont LDAymont CMPypos BNEnotont LDA#0 STAmtype RTS .notont SEI LDAxpos ASL A ASL A ASL A ASL A ASL A ASL A CLC ADC#$80 STAlasad LDA#0 ADC#$37 STA$71 LDAxpos LSR A LSR A CLC ADC$71 ADCypos STA$71 LDAypos ASL A ASL A CLC ADC$71 STAlasad+1 LDAface STAlasdir BEQlefire LDAlasad CLC ADC#$40 STAlasad LDA#9 SEC SBCxpos LDXxpos CPX#1 BEQcorrigf CPX#5 BEQcorrigf BNEfinfire .corrigf INClasad+1 JMPfinfire .lefire DEClasad+1 LDAxpos .finfire ASL A ASL A ASL A CMP#$20 BCCshrange LDA#$1F .shrange STAlastat LDA#0 STAlastep LDA#1 LDXface BNElealt LDA#$FF .lealt CLC ADCxpos STAxf STAxset LDAypos STAyset STAyf JSRgetblock CMP#$10 BCCnoobstr LDA#0 STAlastat .noobstr CLI JMPwait .dispyou LDA#$2F STAwirep 1 STAwirepb 1 LDA#$80 STAwirep LDA#$A0 STAwirepb JMPdispshr .deadedch LDAdeaded BEQnotdeadd LDAmtype CMP#3 BEQnodisp LDA#0 STAmtype .nodisp LDA$7A CLC ADC#$80 STA$70 LDA$7B ADC#2 STA$71 LDY#31 .deada LDA$2FC0,Y STA($7A),Y LDA$2FE0,Y STA($70),Y DEY BNEdeada LDApower STApowchange CLC ADC#4 BCCoverpowm LDA#254 .overpowm STApower LDA#0 STAdeaded .notdeadd RTS .irq INCclock LDA$80 CLC ADC#1 CMPclock BNEnohelpc INC$80 .nohelpc LDAlastat BEQnolas LDAmtype BEQnohitm LDAxmont CMPxf BNEnohitm LDAymont CMPyf BNEnohitm LDA#1 STAlastat STAdeaded .nohitm JSRsavevar DEClastat LDAlastep CLC ADC#8 STAlastep LDAlasdir BEQlasleft BNElasright .nolas JMPROMirq .lasright LDYlastep JSRlaseorp CPY#$28 BCCridel TYA SEC SBC#$20 JSRlaseory .ridel LDAlastat BNEricont LDAlastep SEC SBC#$18 BCSnormn LDA#0 .normn TAY .ristop JSRlaseorp CPYlastep BEQricontb TYA CLC ADC#8 TAY JMPristop .ricontb JSRdelyou .ricont LDAlastep AND#$3F BNErwall INCxf LDAxf STAxset LDAyf STAyset JSRgetblock CMP#$10 BCCrwall LDA#1 STAlastat .rwall JMPloadvar .lasleft LDA#0 SEC SBClastep JSRlaseory CPY#$E0 BCSledel TYA CLC ADC#$20 JSRlaseory .ledel LDAlastat BNElecont LDA#0 SEC SBClastep STAlastep CLC ADC#$18 BCCnorln LDA#$F8 .norln TAY .lestop JSRlaseorp CPYlastep BEQlecontb TYA SEC SBC#8 TAY JMPlestop .lecontb JSRdelyou .lecont LDAlastep AND#$3F BNElwall DECxf LDAxf STAxset LDAyf STAyset JSRgetblock CMP#$10 BCClwall LDA#1 STAlastat .lwall JMPloadvar .laseory TAY .laseorp LDA(lasad),Y EOR#$3F STA (lasad), Y RTS .scroff LDA#0 STAlastat LDA$D011 AND#$EF STA$D011 RTS * = $2300 .savevar LDA$70 STA$88 LDA$71 STA$89 LDA$72 STA$8A LDA$73 STA$8B LDAxset STA$8C LDAyset STA$8D STX$8F STY$87 RTS .loadvar LDA$88 STA$70 LDA$89 STA$71 LDA$8A STA$72 LDA$8B STA$73 LDA$8C STAxset LDA$8D STAyset LDX$8F LDY$87 JMPROMirq .xmom LDXxmont CPXxpos BEQonyou BCCritemt DEX JSRlrxmsh BCSonyou DECxmont LDA#1 .xmend STAmfine RTS .ritemt INX JSRlrxmsh BCSonyou INCxmont LDA#2 BNExmend .onyou LDA#0 BEQxmend .lrxmsh STXxset LDAymont STAyset JSRgetblock CMP#$10 RTS .cmptxt EQUB3 EQUB22 EQUB13 EQUB7 EQUB15 EQUB1 EQUB17 EQUB18 EQUB11 EQUB1 EQUB17 EQUB23 EQUB22 EQUB13 EQUB16 EQUB$FF * = $2D80 .movemst LDAmtype CMP#2 BEQypatrol CMP#1 BNEmovemqut .xpatrol LDAxmont BEQrevdir CMP#9 BEQrevdir ADCmdir STAxset LDAymont STAyset JSRgetblock CMP#$10 BCSrevdir INCyset JSRgetblock CMP#$10 BCCrevdir LDAxset STAxmont .movemqut RTS .revdir LDAmdir EOR#$FE STAmdir CLC ADCxmont STAxmont LDAmfine EOR#3 STAmfine RTS .ypatrol LDXymont CPXypos BEQxadjb BCCdownmt DEX JSRypshr DECymont LDA#6 STAmfine RTS .ypshr STXyset LDAxmont STAxset JSRgetblock CMP#$10 BCSxadj RTS .downmt INX JSRypshr INCymont LDA#5 STAmfine RTS .xadj PLA PLA .xadjb JMPxmom .cmptxtb EQUB7 EQUB1 EQUB12 EQUB5 EQUB0 EQUB3 EQUB22 EQUB12 EQUB14 EQUB11 EQUB5 EQUB17 EQUB5 EQUB$FF \ MOS System * = $3F00 @ = $8000 .keybyte CMP#8 BEQshiftk TAX LDA$DC00 ANDjoyst,X BEQsekey LDA$C5 CMPkeyp,X BEQsekey CLC RTS .sekey SEC RTS .shiftk LDA$28D AND#1 BNEsekey CLC RTS .joyst EQUB4 EQUB8 EQUB1 EQUB2 EQUB$FF EQUB16 EQUB$FF EQUB$FF EQUB$FF EQUB$FF .keyp EQUB12 EQUB23 EQUB37 EQUB36 EQUB60 EQUB0 EQUB41 EQUB57 EQUB$FF EQUB13 .osword RTS .oswrch RTS \ Temporary .ROMirq JMP$EA31