10 ;SUBROUTINE JS15W:THIS SUBROUTINE 20 ;IS USE TO READ IN AND DISPLAY 30 ;THE FRONT VIEW OF THE WIZARD. 40 ;THE WIZARD DRAWING IS DISPLAYED 50 ;IN PLAYER 0. 60 ; 70 JS15W LDY END1+1 ;VERT ENDING POS OF WIZ 80 LDX #7 ;# OF (BYTES-1) TO MOVE 90 W1 LDA WIZ1,X ;GET BYTE OF WIZ DRAWING 0100 STA PL0R,Y ;SAVE IN PLAYER 0 0110 LDA WIZM,X ;GET BYTE OF WIZ DRAWING 0120 ORA MIS,Y ;"OR" SINCE ONLY MISSILE 2AND 3 ARE USED 0130 STA MIS,Y ;SAVE IN MISSILE MEMORY 0140 DEY ;NEXT VERT POS 0150 DEX ;NEXT DRAWING BYTE 0160 BPL W1 0161 LDA #0 0162 STA $D203 0170 RTS 0180 ; 0190 ; 0200 ;SUBROUTINE WIZPOS:THIS SUBROUTINE 0210 ;SETS THE STARTING POS OF THE 0220 ;WIZARD AND IS USED DURING 0230 ;THE COMBAT PHASE 0240 ; 0250 WIZPOS LDA #176 ;VERT END OF WIZ 0260 STA END1+1 0270 LDA #169 ;VERT START OF WIZ 0280 STA TOP1+1 0290 LDA #0 ;SET WIDTH 0300 STA $D008 0310 STA $D00C 0320 LDA #228 ;SET COLOR 0330 STA $02C0 0340 LDX #180 ;HORIZ POS OF WIZ 0350 POSW STX P0 ;SAVE IN POINTER 0360 STX $D000 ;SAVE IN HPOSP0 0370 INX ;POS FOR MISS 3 0380 STX $D006 ;SAVE IN HPOSM2 0390 INX ;SET POS OF MISS 2 0400 INX 0410 INX 0420 STX $D005 ;SAVE IN HPOSM2 0430 WSIGNAL RTS 0440 ; 0450 ; 0460 ;SUBROUTINE JS7W:USED TO MOVE 0470 ;THE WIZARD RIGHT WHEN JPYSTICK 1 0480 ;IS IN POSITION 7 0490 ; 0500 JS7W LDA P0 ;LOAD HORIZ POS 0510 CMP #197 ;IS IT AT RIGHT LIMIT 0520 BCS WSIGNAL ;IF YES ,EXIT 0530 INC P0 ;ELSE ADD 1 TO POS 0540 LDX P0 0550 JMP POSW ;JMP TO MOVE WIZ TO NEW POS 0560 ; 0570 ; 0580 ;SUBROUTINE JS11W:USE TO MOVE 0590 ;THE WIZARD LEFT WHEN JOYSTICK 1 0600 ;IS IN POSITION 7 0610 ; 0620 JS11W LDA P0 ;LOAD HORIZ POS 0630 CMP #53 ;IS IT AT LEFT LIMIT 0640 BCC WSIGNAL ;IF YES ,EXIT 0650 DEC P0 ;ELSE SUB 1 FROM POS 0660 LDX P0 0670 JMP POSW ;JMP TO MOVE WIZ TO NEW POS 0680 ; 0690 ; 0700 ;SUBROUTINE JS13W:MOVES WIZARD 0710 ;DOWN WHEN JOYSTICK 1 IS IN 0720 ;POSITION 13 0730 ; 0740 JS13W LDA END1+1 ;VERT END POS OF WIZ 0750 CMP #207 ;IS IT AT LOWER LIMIT 0760 BCS EX13W ;IF YES ,THEN EXIT 0770 INC END1+1 ;ELSE SET NEW POS 0780 LDX END1+1 0790 LDY #16 ;# OF BYTES TO MOVE 0800 DOWNW LDA PL0R-1,X ;BYTE IN OLD POS 0810 STA PL0R,X ;SAVE IN NEW POS 0820 LDA MIS-1,X ;BYTE IN OLD POS 0830 AND #60 ;"AND" FOR VALUE OF MISSILE 2/3 0840 ORA MIS,X ;"OR" WITH VALUE IN NEW POS 0850 STA MIS,X ;SAVE IN NEW POS 0860 LDA MIS-1,X ;LOAD OLD VALUE 0870 AND #195 ;CLEAR MISSILE 2/3 0880 STA MIS-1,X ;SAVE NEW VALUE IN OLD POS 0890 DEX ;NEXT BYTE TO MOVE 0900 DEY ;ALL BYTES MOVED? 0910 BNE DOWNW 0920 INC TOP1+1 ;SET NEW VERT TOP POS 0930 EX13W RTS 0940 ; 0950 ; 0960 ;SUBROUTINE JS14W:MOVES THE WIZARD 0970 ;UP WHEN JOYSTICK 1 IS IN 0980 ;POSITION 14 0990 ; 1000 JS14W LDA TOP1+1 ;VERT START POS OF WIZ 1010 CMP #33 ;IS IT AT UPPER LIMIT 1020 BCC EX14W ;IF YES ,THEN EXIT 1030 DEC END1+1 ;ELSE SET NEW POS 1040 DEC TOP1+1 1050 LDX TOP1+1 1060 LDY #16 ;#OF BYTES TO MOVE 1070 UPW LDA PL0R+1,X ;VALUE IN OLD POS 1080 STA PL0R,X ;SAVE IN NEW POS 1090 LDA MIS+1,X ;VALUE IN OLD POS 1100 AND #60 ;"AND" TO GET VALUE IN MISSILE 2/3 1110 ORA MIS,X ;"OR" TO SAVE IN NEW POS 1120 STA MIS,X 1130 LDA MIS+1,X ;LOAD VALUE IN OLD POS 1140 AND #195 ;CLEAR MISSILE 2/3 1150 STA MIS+1,X ;SAVE NEW VALUE 1160 INX ;NEXT BYTE TO MOVE 1170 DEY ;ALL BYTES MOVED 1180 BNE UPW 1190 EX14W RTS