&!X;SET2:INITIALIZES PLAYERS AND$X;VARIABLES. CALLED BEFORE CASTLEX;STORIMG SUBROUTINES 9SET2 ZEROPLRS;;JMPSUB TO CLEAR PLAYER/MISSILE MEMORY! JS15G;;JMPSUB TO DISPLAY GUNQ>(PTIMER1;;CLEAR TIMER2PTIMER1<P ;;SET PLAYER WIDTHFP PP ZPdP nQ>;;SET PLAYER PRIORITYxPo:X;#X;SETPOINT:LOAD TABLE OFFSET AND&X;MOVES POINTER TO NEXT TABLE VALUEX;#SETPOINT$T2;;LOAD TABLE OFFSET#T19;;ADD 1 TO TABLE VALUEQT19R>;;IF < 2,DST0;;THEN SET POINTER TO NEXT TABLE POSQ>;;ELSE RESET TABLE VALUEPT19ST0#T2;;NEXT TABLE POSQT2&R>;;TABLE LENGHT IS POS 0 THRU 15DST2 Q>;;RESET TO START OF TABLEPT2ST2:7X;8!X;TWAR:SUBROUTINE USED TO HAVE9 X;TROLLS STORM WIZARDS CASTLE:X;@TWAR SET2J9 ORIGINA;;JMP TO INITIALIZE TEMP11 TO PLAYFIELD STARTTQ>CASTR;;LOAD SCREEN^ PDLIST;;OF WIZARDS CASTLEhQ>CASTR;;BEING ATACKEDr PDLIST| STTQ>$PWIZRDS;;REMOVE TROLL CHARS THAT*PWIZRDS;;ARE IN FRONT OF WIZ CASTLE PT2;;#"TEMP1;;DECREASE # OF TROLLS9TW1QWKING;;LOAD # OF DEFENDING WIZARDS THAT ARE LEFT&FENDWART;;IF= THEN CASTLE OVER RUNQ>;;CHAR 7&8 FORM TROLLPT5;;THAT APPEARS ANDQ>;;ATTACKS WIZARDS CASTLE PT5%%>;;ROW NYTE WHERE TROLLS APPEAR$ DISPTM;;JMPSUB TO DISPLAY TROLL* WARS;;JMPSUB TO MOVE TROLLS AND BOMBS SETPOINT1 LINECNT2;;SET POINTER TO NEXT PLAYFIELD LINE&< ADD1;;ADD 1 TO TIMER FOR HOW LONG CASTLE STORMING LASTS0QTIMER1:-R>;;IF TIMER = 200 THAT STORMING IS OVERDDTW1;;ELSE REPEAT ATTACKINGN! JOYST0;;RESET FOR JOYSTICK 0X$ TEN12;;SET POSITION FOR POINTERb"EWAR PLACE;;SAVE POINTER CHARlQ>BOARD;;DISPLAY MAINvPDLIST;;PLAYFIELD SCREENQ>BOARD PDLIST COLORPL;;SET PLAYER COLOR* ZEROPLRS;;CLEAR PLAYER/MISSILE MEMORY- PLAYERS;;JMPSUB TO BUILD "CHECKER" BOARD DELAY:)ENDWARTQ>;;LEFT HALF OF WIZARD KING(PWIZRDS;;2ND BYTE IN FRONT OF CASTLE"Q>;;RIGHT HALF OF WIZARD KING'PWIZRDS;;BYTE IN FRONT OF CASTLE TEN12;;!EWAR;;JMPSUB TO END FIGHT!X;"#X;WWAR:USE TO HAVE WIZARDS STORM#X;TROLLS CASTLE$X;*WWAR SET24< ORIGIN1;;JMPSUB TO INITIALIZE TEMP11 TO PLAYFIELD START> Q>CASTL;;LOAD ADDRESS OFH!PDLIST;;START OF PLAYFIELDR!Q>CASTL;;INTO DISPLAY LIST\ PDLISTf+ STT;;JMPSUB TO INITIALIZE DELAY TABLESpQ>z PTROL0;;CLEAR BYTES IN FRONTPTROL0;;OF TROLL CASTLEPT2;;CLEAR TABLE POINTER6"TEMP1;;DECREASE # OF WIZARDS ON MAIN PLAYFIELD0WW1QTKING;;TEST FLAG THAT IS = IF 12 TROLLS FENDWARW;;HAVE BEEN CAPTURED%Q>;;RIGHT HALF OF WIZARD DRAWINGPT5$Q>;;LEFT HALF OF WIZARD DRAWING PT58%>#;;SET Y TO POS WHERE WIZARDS WILL APPEAR IN A ROW% DISPTM;;JMPSUB TO DISPLAY WIZARD% WARS2;;JMP TO MOVE WIZARDS/BOMBS) SETPOINT;;JMPSUB TO TEST TABLE VALUE5 LINECNT;;JMP TO SET TEMP11 TO NEXT PLAYFIELD ROW! ADD1;;ADD 1 TO TIMER'S COUNTQTIMER1;;LOAD TIMER$R>;;IF TIMER =200.&DWW1;;THEN CASTLE STORMING IS OVER8 JOYST1;;ENABLE JOYSTICK 1B/ TEN122;;SET CHAR POINTER ON MAIN PLAYFIELDL!EWAR;;JMP TO END WARV#ENDWARWQ>m;;CHAR OF TROLL KING`#PTROL0;;SAVE IN FRONT OF CASTLEj!Q>n;;OTHER HALF OF TROLL KINGt&PTROL0;;SAVE IN FRONT OF CASTLE~/ TEN122;;SET CHAR POINTER ON MAIN PLAYFIELD!EWAR;;JMP TO END WARX;X;ADD1: ADDS 1 TO TIMERX;#ADD1QTIMER1;;LOW BYTE OF TIMER,O> PTIMER1"QTIMER1;;HIGH BYTE OF TIMERO>PTIMER1:X;X;SUBWAR2:USE TO DETERMINEX;THE CHARACTER THAT THEX;TROLL IS MOVING INTOX;;SUBWAR2Q@REM27;;LOAD CHAR THAT TROLL IS COLLIDING WITH+R>9;;CHAR $39 IS ENTRANCE TO WIZ CASTLE HSB2A! TWAR;;JMPSUB TO STORM CASTLE  JOYST0;;ENABLE JOYSTICK 0Q>;;SET FLAG FOR WAR OVER PWARFL(:2(SB2AR>;;CHAR 23 IS 1ST WIZARD CHAR< DSB3AF$R>-;;CHAR 45 IS LAST WIZARD CHARP ESB3AZ- FIGHT;;JMPSUB TO HAVE TROLL/WIZARD FIGHTd JOYST0;;ENABLE JOYSTICK0n/ TEN12;;LOAD CHAR POINTER INTO TEMP STORAGEx* PLACE;;DISPLAY POINTER ON MAIN SCREEN/Q>;;CHAR 24 IS LEFT HALF OF WIZARD DRAWINGPT6;;TEMPORARY SAVE."X;TEMP13 IS THE FLAG THAT HOLDS"X;THE VALUE 1 IF WIZARD WAS HIT X;BY A MISSILE AND VALUE 0 IF"X;TROLL WAS HIT.VALUE IN TEMP13#X;IS CHANGED IN ORDER TO USE THEX;GENERALIZED CODE SUBWAR3.1QTEMP13;;LOAD FLAG FOR TROLL OR WIZARD KILLEDHSTORE0;;SWITCH VALUEQ> PTEMP13"!SUBWAR3;;JMP TO REMOVE LOOSERSTORE0Q> PTEMP13"!SUBWAR3;;JMP TO REMOVE LOOSER" ENDSUB:,%SB3AR>;;CHAR $EF IS WIZARD KING6HENDSUB;;IF <> THEN EXIT@:$>;;ELSE LOAD X WITH CHAR THAT IS RIGHT HALF OF TROLLJ!ENDTWAR;;JMP TO END GAMEKX;L!X;SUBWAR1:USE TO DETERMINE THEMX;CHARACTER THAT THE WIZARDNX;IS MOVING INTOOX;T(SUBWAR1Q@REM27;;LOAD PLAYFIELD BYTE^-R>C;;CHAR $43 IS ENTRANCE TO TROLL CASTLEh HSB1Ar! WWAR;;JMPSUB TO STORM CASTLE| JOYST1;;ENABLE JOYSTICK 1Q>;;SET FLAG FOR WAR OVER PWARFL:%SB1AR>;;CHAR >23 IS TROLL CHARS ESB4A- FIGHT;;JMPSUB TO HAVE TROLL/WIZARD FIGHT JOYST1;;ENABLE JOYSTICK 1 TEN122;;LOAD CHAR POINTER PLACE;;DISPLAY CHAR POINTER&Q>;;CHAR 2 IS RIGHT HALF OF TROLLPT6;;TEMPORARY SAVESUBWAR3%>;;CLEAR Y7QTEMP13;;LOAD FLAG TO DETERMINE WHO HAS BEEN KILLED HKILLWZR2/Q@REM27;;LOAD PLAYFIELD BYTE OF MAIN SCREEN!RT6;;CMP TO RIGHT HALF OF MAN&HKT1;;IF <> THE REMOVE CHAR0;;;ELSE SUBTRACT 1 FROM:$QREM2;;ADDRESS OF PLAYFIELD BYTEDS>N PREM2X QREM2bS>l PREM2vQ@REM27;;TEST TO SEE IF)HKT1;;HAS A CHAR IN IT.IF IT DOES NOT-3;;THEN ADD 1 TO ADDRESS OF PLAYFIELD BYTE/KT1Q>;;USE CHAR 0 TO CLEAR PLAYFIELD BYTE P@REM273 P@REM27:%KILLWZR2Q>;;USE CHAR 0 TO CLEARP@REM17;;PLAYFIELD BYTE3;;NEXT PLAYFIELD BYTEP@REM17;;CLEAR BYTE ENDSUB2:$SB4AR>n;;CHAR $6E IS TROLL KING+HENDSUB2;;IF <> THEN EXIT ELSE END GAME ($>;;CHAR 24 IS RIGHT HALF OF WIZARDENDTWAR&T5;;TEMP SAVE /0;;SET X TO BE CHAR THAT IS LEFT HALF OF MAN*&T5;;TEMP SAVE4A>)$>;;SET X TO START OF PLAYFIELD AREAH,ENDLOOP2PBOARD9;;SAVE CHAR IN PLAYFIELDRPBOARD9\PBOARD9fPBOARD9pRT5;;TEST ACCUMULATORzFLD24;;CHANGE AS NECESSARYQT5;;IN ORDER TO DISPLAY!NEXTS2;;FRONT VIEW OF MANLD24QT5 NEXTS22(>;;IF X = 240 THEN-HENDLOOP2;;SCREEN IS FILLED WITH MAN CHAR* ZEROPLRS;;CLEAR PLAYER/MISSILE MEMORY!ENDLESS2!ENDLESS2;;GAME OVERX;#X;FIGHT:SUBROUTINE TO HAVE TROLLX;COMBAT WITH WIZARDX;FIGHTQ>;;P;;SET HIT CLEAR1PFSQ1;;SET FLAG TO ENABLE MISSILE TO BE FIRED PFSQ2* ZEROPLRS;;CLEAR PLAYER/MISSILE MEMORY ( WIZPOS;;INITIALIZE WIZARD VARIABLES ' MANPOS;;INITIALIZE TROLL VARIABLES >PTROLWIZ;;SET FLAG TO ALLOW TROLL SUBROUTINES TO BE CALLED$  JS15M;;DISPLAY TROLL.  JS15W;;DISPLAY WIZARD8 #Q>DLIST2;;LOAD DISPLAY LISTB P1;;THAT IS USEDL )Q>DLIST2;;WHEN TROLL FIGHTS WIZARDV P0` Q>j PTEMP1t Q>~ 3PDIRFLAG;;FLAG FOR DIRECTION OF TROLL'S MISSILE 6PDIRFLAG;;FLAG FOR DIRECTION OF WIZARDS MISSILE *PSQFLAG;;FLAG FOR TROLLS MISSILE FIRED .PSQFLAG;;FLAG FOR WIZARDS MISSILE FIRED PDIRECT *PWARFL;;SET FLAG FOR FIGHT HAS STARTED Q> &PTEMP1 ;;CLEAR END OF FIGHT FLAG 2PTEMP13;;CLEAR FLAG FOR TROLL OR WIZARD KILLED Q> PDA1;;SET DELAY VALUE QREM1 PTEMP10;;SAVE POS OF #QREM1;;MAN THAT IS ATTACKING PTEMP10 9 STICK15;;DISPLAY FRONT VIEW OF MAN THAT IS ATTACKING Q>( *PJSTCKV;;SET HIGH BYTE FOR JOYSTICK2 %F1$>;;OFFSET FOR TROLL VARIABLE< %&TROLWIZ;;SET FLAG FOR TROLL TURNF Q>xP PJSTCKV;;ENABLE JOYSTICK 0Z  MOVMAN;;MOVE TROLLd #$>;;OFFSET FOR WIZARD VARIABLEn Q>x &PTROLWIZ;;SET FLAG FOR WIZARD TURN #JSTCKV;;ENABLE JOYSTICK 1  MOVMAN;;MOVE WIZARD DELAY $QTEMP1 ;;IF TEMP1+10 IS = THEN 0FF1;;FIGHT NOT OVER.BRANCH TO CONTINUE FIGHT Q> PDA1;;SET DELAY VALUE  DELAY;;JMPSUB TO DELAY  DELAY;;THE CHANGE FROM  DELAY;;THE FIGHT SCREEN  DELAY;;TO THE MAIN SCREEN * INIT1;;JMPSUB TO INITIALIZE VARIABLES 4 ZEROPLRS;;JMPSUB TO CLEAR PLAYER/MISSILE MEMORY - PLAYERS;;JMPSUB TO BUILD "CHECKER" BOARD : X; $X;DISPTM:USE TO DISPLAY ATTACKING !X;MEN.DISPLAYS MEN RANDOMLY ON X;EACH PLAYFIELD ROW X; !DISPTM$T2;;LOAD TABLE OFFSET" $OO5QTABLE39;;HIGH BYTE OF DELAY, HOO66 QTABLE29;;LOW BYTE OF DELAY@ FOO7J OO6;T QTABLE29;;SUBTRACT 1 FROM^ S>;;DELAY TABLEh PTABLE29r QTABLE39| S> PTABLE39 :;;EXIT &OO7Q@TEMP117;;LOAD PLAYFIELD BYTE HOO4;;IF <> THEN EXIT QTABLE79;;DELAY VALUE PTABLE29;;SAVE IN LOW BYTE QTABLE59;;DELAY VALUE PTABLE39;;SAVE IN HIGH BYTE "Q@TEMP117;;LOAD PLAYFIELD BYTE HOO4;;IF <> THEN EXIT *QT5;;LOAD CHAR DRAWING OF ATTACKER P@TEMP117;;SAVE IN PLAYFIELD 1;;NEXT PLAYFIELD BYTE &QT5;;LOAD CHAR DRAWING OF ATTACKER %P@TEMP117;;SAVE IN PLAYFIELD BYTE OO4: X; !X;STT:SUBROUTINE TO LOAD DELAY X;VALUES INTO DELAY TABLE. "X;THE TABLE IS USE TO DETERMINE! X;HOW LONG BEFORE ATTACKER" X;APPEARS ON A ROW# X;& STT$>;;(LENGTH-1) OF TABLE0 #STT2QTABLE79;;LOAD DELAY VALUE: 'PTABLE29;;SAVE IN LOW BYTE OF DELAYD QTABLE59;;LOAD DELAY VALUEN PTABLE39;;SAVE IN HIGH BYTEX Q>;;SET DELAY VALUEb ;PT19;;SAVE IN TABLE THAT MUST = 1 BEFORE ATTACKER MOVESl 0;;NEXT TABLE POSv ISTT2 : X; X; @PREWAR1 SAVETEMP;;JMPSUB TO SAVE CURRENT POS BEING ATTACKED  SUB401;;RESET POINTER : @PREWAR2 SAVETEMP;;JMPSUB TO SAVE CURRENT POS BEING ATTACKED  ADD401;;RESET POINTER : SAVETEMPQTEMP10;;LOW BYTE PREM2;;TEMPORARY SAVE QTEMP10;;HIGH BYTE PREM2 :