#include "sngbeta.inc" .ORG START_ADDR pencol = $8215 penrow = $8216 bufcpy = GRB_COPY PLOTSSCREEN = $88B8 textflags = 5 ; IY OFFSET VALUE texteraseBelow = 1 textsscrolled = 2 textInverse = 3 Lunderscore = 05fh ;5fh lspace = 020h curcol = $800D currow = $800C SAVESSCREEN = $808F _clrlcdfull = CLEARLCD ;82 name 83 name 82 addr 83 addr ;RAM addresses ;------------- ;KEY_0 KEY0 8000 * 8000 * ;KEY_1 KEY1 8001 * 8001 * ;KEY_2 KEY2 8002 * 8002 * ;VAT_END_PTR VATEND 8D12 * 9311 * ;VAT_START SYMTABLE FE6E * FE6E * ;Op instructions ;--------------- _OP2TOOP1 = $1A0F-$1A _OP3TOOP1 = $19DA-$1A _OP4TOOP1 = $19D0-$1A _OP5TOOP1 = $19D5-$1A _OP6TOOP1 = $19CB-$1A _OP1TOOP2 = $0008-$1A _OP3TOOP2 = $1993-$1A _OP4TOOP2 = $198A-$1A _OP5TOOP2 = $19A3-$1A _OP6TOOP2 = $19C3-$1A _OP1TOOP3 = $199B-$1A _OP2TOOP3 = $1A6E-$1A _OP4TOOP3 = $1A76-$1A _OP5TOOP3 = $1A7B-$1A _OP1TOOP4 = $1978-$1A _OP2TOOP4 = $1981-$1A _OP3TOOP4 = $196F-$1A _OP5TOOP4 = $19B3-$1A _OP1TOOP5 = $1A07-$1A _OP2TOOP5 = $19EF-$1A _OP3TOOP5 = $19E7-$1A _OP4TOOP5 = $19DF-$1A _OP1TOOP6 = $19FF-$1A _OP2TOOP6 = $19F7-$1A _OP4TOOP6 = $1A80-$1A _OP5TOOP6 = $19AB-$1A ;_MOVEREG 1A15 41C6 _OP1EXOP2 = $1D33-$1A _OP1EXOP3 = $1D29-$1A _OP1EXOP4 = $1D2E-$1A _OP1EXOP5 = $1D12-$1A _OP1EXOP6 = $1D17-$1A _OP2EXOP4 = $1D1C-$1A _OP2EXOP5 = $1D21-$1A _OP2EXOP6 = $1D05-$1A _OP5EXOP6 = $1D0A-$1A _ZEROOP1 = $1B21-$1A _ZEROOP2 = $1B26-$1A _ZEROOP3 = $1B2B-$1A _ZEROOP = $1B2E-$1A ;LD_OP1_CONST ? 1DEF _CKOP1REAL = $190B-$1A _OP1SET0 = $1B16-$1A _OP1SET1 = $1ABF-$1A ;LD_OP1_2 = _OP1SET2 1AD7 4242 ;LD_OP1_3 = _OP1SET3 1ACB 423A ;LD_OP1_4 = _OP1SET4 1AC4 4236 ;LD_OP2_0 _OP2SET0 1B11 4282 ;LD_OP2_1 _OP2SET1 1AE7 4252 ;LD_OP2_2 _OP2SET2 1ADC 4246 ;LD_OP2_3 _OP2SET3 1AB7 422E ;LD_OP2_4 _OP2SET4 1AB0 422A ;LD_OP2_5 _OP2SET5 1AA9 4222 ;LD_OP2_8 _OP2SET8 1AA2 421E ;LD_OP3_0 _OP3SET0 1B0C 427E ;LD_OP3_1 _OP3SET1 1A9D 421A ;LD_OP3_2 _OP3SET2 1AD2 423E ;LD_OP4_0 _OP4SET0 1B07 427A ;LD_OP4_1 _OP4SET1 1A98 4216 ;RANDOM_OP1 _RANDOM 3566 * 50B6 _SETXXXXOP2 = $35B4-$1a _CONVOP1 = $35BA-$1a ;Math ;---- _CPOP1OP2 = $192C-$1A ;ADD_OP1_OP2 _FPADD 0851 4092 ;SUB_OP1_OP2 _FPSUB 0847 408E ;SUB_OP2_OP1 _INVSUB 083A 407E ;MUL_OP1_OP2 _FPMULT 0925 40AA ;DIV_OP1_OP2 _FPDIV 13C1 40C6 ;RECIP_OP1 _FPRECIP ---- 40C2 ;NEG_OP1 _INVOP1S ---- 40B6 ;ABS_OP1 _CLROP1S 1EC5 4362 ;ABS_OP2 _CLROP2S 1EC0 435E _DIVHLBYA = $00A3 ;MUL_OP1_2 _TIMES2 083F 4082 ;DEG_TO_RAD _DTOR 0905 4096 ;RAD_TO_DEG _RTOD 090E 409A ;DEC_OP1 _MINUS1 0847 408A ;INC_OP1 _PLUS1 0842 4086 ;IPART_OP1 _TRUNC 0836 407A ;SIN_OP1 _SIN 10E0 40F6 ;COS_OP1 _COS 10E4 40FA ;TAN_OP1 _TAN 10E8 40FE ;ASIN_OP1 _ASIN 156D 412A ;ACOS_OP1 _ACOS 1567 4122 ;ATAN_OP1 _ATAN 1578 4126 ;Z80 Ease of use routines ;------------------------ ;LD_HL_MHL _LDHLIND 0033 * 4000 _CPHLDE = $0095 ;CP_HL_BC _CPHLBC ---- * ---- ;CP_DE_BC _CPDEBC ---- * ---- ;EX_BC_HL _EXBCHL ---- * ---- ;EX_BC_DE _EXBCDE ---- * ---- ;UNPACK_HL _DIVHLBY10 00A1 * ---- ;DIV_HL_A _DIVHLBYA 00A3 * 400C ;_Htimesl = $1F18-$1A ;LIST_MUL _HLTIMES9 1901 4146 ;NEG_BC _NEGBC 284F ---- ;EXIT_2_TIOS _EXIT ---- * ---- ;RAND _CRRAND ---- * ---- ;_HTIMESL = $1F18-$1a ;Calculator specific!!! _FARCALL = $2E60-$1a ;Keyboard ;-------- ;KEY_READ _RAWKEY 01B8 ---- _SETCSC = $01C7 _GETCSC = $01D4 _GETKEY = KEY_HAND _getk = $2F48-$1a ;Memory/VAT ;---------- ;BYTES_FREE _MEMCHK 20C5 * 441A ;FIND_SYM _CHKFINDSYM 213E * 442A ;FIND_SYM_NOPROG _FINDSYM 2143 442E ;INSERT_MEM _INSERTMEM 2272 * 4432 ;DEL_MEM _DELMEM 25A7 * 44B2 ;DEL_VAR _DELVAR 2561 * 44AA ;VAR_SIZE _DATASIZEA 26AF 44CA ;FIND_BIT _ISINSET 2975 46B5 ;CREATE_PROG _CREATEPROG 23B1 * 448A ;CREATE_LIST _CREATERLIST 2359 * 445A ;SCAN_VAT _SCANVAT ---- * ---- ;FIND_VAT_BYADDR _FINDVATBYADDR ---- ---- ;Display ;------- _PUTMAP = $3752-$1a _PUTC = $39EC-$1a _VPUTMAP = $37E8-$1a _VPUTS = $37EE-$1a _VPUTPS = $37F4-$1a _PUTS = $3914-$1a _PUTPS = $3758-$1a _GRBUFCPY_V = GRB_COPY _DISPHL = $3896-$1a ;DISP_OP1_A _DISPOP1A ---- * 51D4 _NEWLINE = $3794-$1a _CLRTXTSHD = $37C4-$1a _HOMEUP = $391A-$1a ;[17:30] b = x, c=y, d=1 (ON) ; #DEFINE kDown 01h #DEFINE kLeft 02h #DEFINE kRight 03h #DEFINE kUp 04h #DEFINE kEnter 09h #DEFINE kMode 37h #DEFINE kDel 38h #DEFINE kYEq 35h #DEFINE k2nd 36h #DEFINE kAlpha 30h #define xmm SAVESSCREEN ; Mega Man's x-coord #define ymm SAVESSCREEN+2 ; Mega Man's y-coord #define jrem SAVESSCREEN+3 ; remebers the y-coord where the jump started #define jchk SAVESSCREEN+4 ; check for jump: 0=no jump 1=jump up 2=jump down #define wchk SAVESSCREEN+5 ; check if ok to shoot again: 0=yes >0=no #define dir SAVESSCREEN+6 ; direction Mega Man is facing: 0=left 1=right #define x2 SAVESSCREEN+7 ; x-coord for many different things #define y2 SAVESSCREEN+8 ; y-coord for many different things #define xb SAVESSCREEN+9 ; x-coord for boss #define yb SAVESSCREEN+10 ; y-coord for boss #define wx1 SAVESSCREEN+11 ; x-coord for 1st shot #define wy1 SAVESSCREEN+12 ; y-coord for 1st shot #define wx2 SAVESSCREEN+13 ; x-coord for 2nd shot #define wy2 SAVESSCREEN+14 ; y-coord for 2nd shot #define wx3 SAVESSCREEN+15 ; x-coord for 3rd shot #define wy3 SAVESSCREEN+16 ; y-coord for 3rd shot #define bdir SAVESSCREEN+17 ; direction of boss: 0=left 1=right #define wdir1 SAVESSCREEN+18 ; direction of 1st shot: 0=left 1=right #define wdir2 SAVESSCREEN+19 ; direction of 2nd shot: 0=left 1=right #define wdir3 SAVESSCREEN+20 ; direction of 3rd shot: 0=left 1=right #define wchk1 SAVESSCREEN+21 ; check if bullet #1 is still on screen: 0=no 1=yes #define wchk2 SAVESSCREEN+22 ; check if bullet #2 is still on screen: 0=no 1=yes #define wchk3 SAVESSCREEN+23 ; check if bullet #3 is still on screen: 0=no 1=yes #define curlvl SAVESSCREEN+24 ; pointer to the beginning of the level data #define feet SAVESSCREEN+26 ; check for which running sprite to use: 0 or 1 #define xscr SAVESSCREEN+27 ; x scroller #define tempscr SAVESSCREEN+29 ; amount scrolled within incomplete block #define schk SAVESSCREEN+31 ; scroll check: 0=no 1=yes #define boss SAVESSCREEN+33 ; which boss u will face: 1 2 3=top row 4 5 6=middle row 7 8 9=bottom row #define wpnspr SAVESSCREEN+34 ; current weapon sprite #define smlspr SAVESSCREEN+36 ; current 8x8 sprite #define curpic SAVESSCREEN+38 ; current pic to draw #define bosspic SAVESSCREEN+40 ; current boss sprite #define death SAVESSCREEN+42 ; check if dead: 0=no 1=yes #define win SAVESSCREEN+44 ; check if level is completed: 0=no 1=yes #define xe SAVESSCREEN+45 ; x-coord for enemy #define ye SAVESSCREEN+46 ; y-coord for enemy #define edir SAVESSCREEN+47 ; direction enemy is travelling #define echk SAVESSCREEN+48 ; check for onscreen enemy: 0=no 1=i 2=t 3=dead #define enspr SAVESSCREEN+49 ; current enemy sprite #define ecount SAVESSCREEN+51 ; counts how many pixels enemy has moved (32 pixels allowed) #define ecount2 SAVESSCREEN+52 ; counts how many pixels have scrolled since enemy appeared #define bchk SAVESSCREEN+53 ; checks for boss: 0=no 1=yes #define bwx SAVESSCREEN+54 ; x-coord of boss's shot #define bwspr SAVESSCREEN+55 ; sprite for boss's shot #define bwchk SAVESSCREEN+57 ; check for boss's shot onscreen #define bjchk SAVESSCREEN+58 ; check for boss's jump: 0=no jump 1=jump down 2=jump up #define lvldone SAVESSCREEN+59 ; checks levels completed: 0 1 2=top row 3 _ 4=middle row 5 6 7=bottom row #define anpw SAVESSCREEN+60 ; checks for password dots corresponding to Anchorman #define mapw SAVESSCREEN+61 ; checks for password dots corresponding to Mailman #define mdpw SAVESSCREEN+62 ; checks for password dots corresponding to Madman #define dopw SAVESSCREEN+63 ; checks for password dots corresponding to Doorman #define popw SAVESSCREEN+64 ; checks for password dots corresponding to Policeman #define frpw SAVESSCREEN+65 ; checks for password dots corresponding to Freshman #define sepw SAVESSCREEN+66 ; checks for password dots corresponding to Top Secret Weapon #define sapw SAVESSCREEN+67 ; checks for password dots corresponding to Salesman #define mipw SAVESSCREEN+68 ; checks for password dots corresponding to Milkman #define tankpw SAVESSCREEN+69 ; checks for password dots corresponding to energy tanks #define lives SAVESSCREEN+70 ; the number of lives you have #define tanks SAVESSCREEN+71 ; the number of energy tanks you have #define remlvl SAVESSCREEN+72 ; remembers which level you were on before the special boss screens #define wpn SAVESSCREEN+74 ; which weapon you are using: 1=an...5=??...9=mi #define wrem1 SAVESSCREEN+75 ; remembers x-coord where short-range bullet #1 must stop #define wrem2 SAVESSCREEN+76 ; remembers x-coord where short-range bullet #2 must stop #define wrem3 SAVESSCREEN+77 ; remembers x-coord where short-range bullet #3 must stop #define bcount SAVESSCREEN+78 ; special counting variable used for final bosses #define item SAVESSCREEN+79 ; check for item in level: 0=no 1=yes 2=got #define enp SAVESSCREEN+80 ; life energy #define enan SAVESSCREEN+81 ; energy for anchor toss #define enma SAVESSCREEN+82 ; energy for stamp throw #define enmd SAVESSCREEN+83 ; energy for swearing scream #define endo SAVESSCREEN+84 ; energy for splinter shot #define ense SAVESSCREEN+85 ; energy for top secret weapon #define enpo SAVESSCREEN+86 ; energy for badge boomerang #define enfr SAVESSCREEN+87 ; energy for zit shield #define ensa SAVESSCREEN+88 ; energy for bill charge #define enmi SAVESSCREEN+89 ; energy for milk bubble #define enwpn SAVESSCREEN+90 ; energy for current weapon #define ene SAVESSCREEN+91 ; energy for enemy #define enb SAVESSCREEN+92 ; energy for boss #define hchk SAVESSCREEN+93 ; check if you've been hit: 0=no 1=yes Description: .db "Mega Man 82-ASM",0 prog_start: call BUFCLR call BUFCOPY ld hl,15*256+18 ld (pencol),hl ld hl,djs ROM_CALL(_VPUTS) ld hl,25*256+33 ld (pencol),hl ld hl,pre ROM_CALL(_VPUTS) djsp_loop: ROM_CALL(_getk) cp kMode ret z or a jr z,djsp_loop call BUFCOPY ld hl,1*256+1 ld (pencol),hl ld hl,intro1 ROM_CALL(_VPUTS) ld hl,7*256+1 ld (pencol),hl ld hl,intro2 ROM_CALL(_VPUTS) ld hl,13*256+1 ld (pencol),hl ld hl,intro3 ROM_CALL(_VPUTS) ld hl,19*256+1 ld (pencol),hl ld hl,intro4 ROM_CALL(_VPUTS) ld hl,25*256+1 ld (pencol),hl ld hl,intro5 ROM_CALL(_VPUTS) ld hl,31*256+1 ld (pencol),hl ld hl,intro6 ROM_CALL(_VPUTS) ld hl,37*256+1 ld (pencol),hl ld hl,intro7 ROM_CALL(_VPUTS) ld hl,43*256+1 ld (pencol),hl ld hl,intro8 ROM_CALL(_VPUTS) ld hl,49*256+1 ld (pencol),hl ld hl,intro9 ROM_CALL(_VPUTS) ld hl,55*256+1 ld (pencol),hl ld hl,intro10 ROM_CALL(_VPUTS) story_loop: ROM_CALL(_getk) cp kMode ret z or a jr z,story_loop call BUFCOPY ld hl,1*256+1 ld (pencol),hl ld hl,intro11 ROM_CALL(_VPUTS) ld hl,7*256+1 ld (pencol),hl ld hl,intro12 ROM_CALL(_VPUTS) ld hl,13*256+1 ld (pencol),hl ld hl,intro13 ROM_CALL(_VPUTS) ld hl,19*256+1 ld (pencol),hl ld hl,intro14 ROM_CALL(_VPUTS) ld hl,25*256+1 ld (pencol),hl ld hl,intro15 ROM_CALL(_VPUTS) ld hl,31*256+1 ld (pencol),hl ld hl,intro16 ROM_CALL(_VPUTS) ld hl,37*256+1 ld (pencol),hl ld hl,intro17 ROM_CALL(_VPUTS) ld hl,43*256+1 ld (pencol),hl ld hl,intro18 ROM_CALL(_VPUTS) ld hl,49*256+1 ld (pencol),hl ld hl,intro19 ROM_CALL(_VPUTS) ld hl,55*256+1 ld (pencol),hl ld hl,intro20 ROM_CALL(_VPUTS) story_loop2: ROM_CALL(_getk) cp kMode ret z or a jr z,story_loop2 ROM_CALL(_clrlcdfull) call BUFCLR xor a ; no levels completed ld (lvldone),a ld (tanks),a ; 0 energy tanks inc a ld (tankpw),a ; 0 energy tanks (for password system) inc a inc a ld (lives),a ; 3 lives ld hl,logo ; display title screen ld de,PLOTSSCREEN ld bc,768 ldir call BUFCOPY ld a,17 ld (x2),a ld a,43 ld (y2),a ld hl,pwdot ld (smlspr),hl menu_loop: call xor_8x8 call BUFCOPY call xor_8x8 ROM_CALL(_getk) cp kUp jr z,curs_change cp kDown jr z,curs_change cp kEnter jr z,title_done cp kMode jr nz,menu_loop ret curs_change: ld a,(y2) ld b,a ld a,97 sub b ld (y2),a jr menu_loop title_done: ld a,(y2) cp 43 jr z,cb_init call enter_pw cp kMode ; exit game if MODE was pressed on enter password screen ret z cb_init: ld a,33 ld (x2),a ld a,22 ld (y2),a ROM_CALL(_clrlcdfull) choose_boss: call BUFCLR ld hl,cbs ld de,PLOTSSCREEN ld bc,768 ldir ld a,(lvldone) ld c,a bit 0,c call nz,no_an bit 1,c call nz,no_ma bit 2,c call nz,no_md bit 3,c call nz,no_do bit 4,c call nz,no_po bit 5,c call nz,no_fr bit 6,c call nz,no_sa bit 7,c call nz,no_mi call BUFCOPY boss_loop: call xor_corners call BUFCOPY call xor_corners ROM_CALL(_getk) cp kUp jr z,bcurs_up cp kDown jr z,bcurs_down cp kLeft jr z,bcurs_left cp kRight jr z,bcurs_right cp kEnter jr z,find_boss cp kMode jr nz,boss_loop ROM_CALL(_getk) ; clear the keybuffer call BUFCLR ROM_CALL(_clrlcdfull) ret bcurs_up: ld a,(y2) cp 1 jr z,boss_loop ld a,(y2) sub 21 ld (y2),a jr boss_loop bcurs_down: ld a,(y2) cp 43 jp z,boss_loop ld a,(y2) add a,21 ld (y2),a jp boss_loop bcurs_left: ld a,(x2) cp 2 jp z,boss_loop ld a,(x2) sub 31 ld (x2),a jp boss_loop bcurs_right: ld a,(x2) cp 64 jp z,boss_loop ld a,(x2) add a,31 ld (x2),a jp boss_loop find_boss: ld a,(y2) cp 1 jr z,row1 cp 22 jr z,row2 ld a,7 jr found_row row2: ld a,4 jr found_row row1: ld a,1 found_row: ld (boss),a ld a,(x2) cp 64 jr z,add2 cp 33 jr nz,add0 ld a,(boss) inc a jr add_done add0: ld a,(boss) jr add_done add2: ld a,(boss) add a,2 add_done: ld (boss),a ld a,44 ld (xb),a ld a,27 ld (yb),a ld a,(boss) cp 1 jr z,an_init cp 2 jr z,ma_init cp 3 jr z,md_init cp 4 jp z,do_init cp 5 jp z,ti_init cp 6 jp z,po_init cp 7 jp z,fr_init cp 8 jp z,sa_init cp 9 jp z,mi_init an_init: ld a,(lvldone) bit 0,a jp nz,choose_boss ld hl,ansl call disp_boss ld hl,wpan ld (bwspr),hl ld hl,54*256+30 ld (pencol),hl ld hl,a_n ROM_CALL(_VPUTS) ld hl,lvlan jp intro_done ma_init: ld a,(lvldone) bit 1,a jp nz,choose_boss ld hl,masl call disp_boss ld hl,wpma ld (bwspr),hl ld hl,54*256+34 ld (pencol),hl ld hl,m_a ROM_CALL(_VPUTS) ld hl,lvlma jp intro_done md_init: ld a,(lvldone) bit 2,a jp nz,choose_boss ld hl,mdsl call disp_boss ld hl,wpmd ld (bwspr),hl ld hl,54*256+36 ld (pencol),hl ld hl,m_d ROM_CALL(_VPUTS) ld hl,lvlmd jp intro_done do_init: ld a,(lvldone) bit 3,a jp nz,choose_boss ld hl,dosl call disp_boss ld hl,wpdo ld (bwspr),hl ld hl,54*256+34 ld (pencol),hl ld hl,d_o ROM_CALL(_VPUTS) ld hl,lvldo jp intro_done ti_init: ld a,(lvldone) bit 0,a jp z,choose_boss bit 1,a jp z,choose_boss bit 2,a jp z,choose_boss bit 3,a jp z,choose_boss bit 4,a jp z,choose_boss bit 5,a jp z,choose_boss bit 6,a jp z,choose_boss bit 7,a jp z,choose_boss ld hl,tisl call disp_boss ld hl,wpp ld (bwspr),hl ld hl,54*256+22 ld (pencol),hl ld hl,t_i ROM_CALL(_VPUTS) ld hl,lvlti jp intro_done po_init: ld a,(lvldone) bit 4,a jp nz,choose_boss ld hl,posl call disp_boss ld hl,wppo ld (bwspr),hl ld hl,54*256+30 ld (pencol),hl ld hl,p_o ROM_CALL(_VPUTS) ld hl,lvlpo jr intro_done fr_init: ld a,(lvldone) bit 5,a jp nz,choose_boss ld hl,frsl call disp_boss ld hl,wpfr ld (bwspr),hl ld hl,54*256+32 ld (pencol),hl ld hl,f_r ROM_CALL(_VPUTS) ld hl,lvlfr jr intro_done sa_init: ld a,(lvldone) bit 6,a jp nz,choose_boss ld hl,sasl call disp_boss ld hl,wpsa ld (bwspr),hl ld hl,54*256+32 ld (pencol),hl ld hl,s_a ROM_CALL(_VPUTS) ld hl,lvlsa jr intro_done mi_init: ld a,(lvldone) bit 7,a jp nz,choose_boss ld hl,misl call disp_boss ld hl,wpmi ld (bwspr),hl ld hl,54*256+34 ld (pencol),hl ld hl,m_i ROM_CALL(_VPUTS) ld hl,lvlmi intro_done: ld (curlvl),hl ; remember the start of the level ld (remlvl),hl call delay ROM_CALL(_clrlcdfull) call BUFCLR call wpn_fill part1_init: call init_vars ld a,44 ; initialize some variables ld (ymm),a xor a ld (jchk),a ld (bchk),a ld (wpn),a inc a ld (dir),a ld (schk),a ld hl,wpp ld (wpnspr),hl call ShowLevel call main_loop ROM_CALL(_getk) ; clear the keybuffer call BUFCLR ROM_CALL(_clrlcdfull) ld a,(death) ; check if died or a jp nz,lost_life ld a,(win) or a ret z ; exit loop if level has not been completed part2_init: ld hl,lvlb1 xor a ld (bchk),a call init_lvlb ld a,(death) ; check if died or a jp nz,lost_life ld a,(win) or a ret z ; exit loop if level has not been completed xor a ; initialize boss variables ld (bdir),a ld (bjchk),a inc a ld (bchk),a ld a,28 ld (enb),a ld a,44 ld (yb),a ld a,76 ld (xb),a ld hl,lvlb2 call init_lvlb ld a,(death) ; check if died or a jp nz,lost_life ld a,(win) or a ret z ; exit game if level has not been completed ld a,(lvldone) ld b,a ld a,(boss) cp 5 jp z,final_boss cp 1 jr z,set_bit0 cp 2 jr z,set_bit1 cp 3 jr z,set_bit2 cp 4 jr z,set_bit3 cp 6 jr z,set_bit4 cp 7 jr z,set_bit5 cp 8 jr z,set_bit6 set 7,b jr set_bit_done set_bit6: set 6,b jr set_bit_done set_bit5: set 5,b jr set_bit_done set_bit4: set 4,b jr set_bit_done set_bit3: set 3,b jr set_bit_done set_bit2: set 2,b jr set_bit_done set_bit1: set 1,b jr set_bit_done set_bit0: set 0,b set_bit_done: ld a,b ld (lvldone),a call you_got ; show "you got x weapon" screen cp kMode ; exit is MODE was pressed at you got screen ret z call show_pw ; show password cp kMode ; exit if MODE was pressed at show password screen ret z jp cb_init lost_life: call wpn_fill ld a,(lives) ; go to game over screen if all lives lost or a jr z,game_over ld a,(schk) or a jp z,part2_init jp part1_init game_over: call show_pw cp kMode ; exit if MODE was pressed at show password screen ret z ld a,3 ld (lives),a ROM_CALL(_clrlcdfull) call BUFCLR ld d,13 ld e,17 ld h,80 ld l,17 ld b,1 call FLine ld e,46 ld l,46 call FLine ld d,12 ld e,18 ld h,12 ld l,45 call FLine ld d,81 ld h,81 call FLine call BUFCOPY ld hl,18*256+31 ld (pencol),hl ld hl,gover ROM_CALL(_VPUTS) ld hl,25*256+25 ld (pencol),hl ld hl,cont ROM_CALL(_VPUTS) ld hl,32*256+14 ld (pencol),hl ld hl,stgsel ROM_CALL(_VPUTS) ld hl,39*256+31 ld (pencol),hl ld hl,endgame ROM_CALL(_VPUTS) call BUFCLR go_loop: ROM_CALL(_getk) cp k2nd jr z,go_cont cp kAlpha jp z,cb_init cp kMode ret z jr go_loop go_cont: ld hl,(remlvl) ld (curlvl),hl jp part1_init final_boss: xor a ld (boss),a ld (win),a call main_loop ld a,(death) ; check if died or a jp nz,lost_life ld a,(win) or a ret z ; exit game if level has not been completed ending: ROM_CALL(_clrlcdfull) call BUFCLR ld d,0 ld e,36 ld h,94 ld l,36 ld b,1 call FLine ld a,24 ld (ymm),a ld (yb),a ld hl,20 ld (xmm),hl ld hl,mmwr ld (curpic),hl call xor_char ld a,68 ld (xb),a ld hl,tisl ld (bosspic),hl call xor_boss call BUFCOPY ld hl,37*256+1 ld (pencol),hl ld hl,end1 ROM_CALL(_VPUTS) ld hl,43*256+1 ld (pencol),hl ld hl,end2 ROM_CALL(_VPUTS) ld hl,49*256+1 ld (pencol),hl ld hl,end3 ROM_CALL(_VPUTS) ld hl,55*256+1 ld (pencol),hl ld hl,end4 ROM_CALL(_VPUTS) call long_delay call BUFCOPY ld hl,37*256+1 ld (pencol),hl ld hl,end5 ROM_CALL(_VPUTS) ld hl,43*256+1 ld (pencol),hl ld hl,end6 ROM_CALL(_VPUTS) ld hl,49*256+1 ld (pencol),hl ld hl,end7 ROM_CALL(_VPUTS) ld hl,55*256+1 ld (pencol),hl ld hl,end8 ROM_CALL(_VPUTS) call long_delay call xor_char ld hl,mmsl ld (curpic),hl call xor_char call BUFCOPY ld hl,37*256+1 ld (pencol),hl ld hl,end9 ROM_CALL(_VPUTS) ld hl,43*256+1 ld (pencol),hl ld hl,end10 ROM_CALL(_VPUTS) ld hl,49*256+1 ld (pencol),hl ld hl,end11 ROM_CALL(_VPUTS) ld hl,55*256+1 ld (pencol),hl ld hl,end12 ROM_CALL(_VPUTS) call long_delay call BUFCOPY ld hl,37*256+1 ld (pencol),hl ld hl,end13 ROM_CALL(_VPUTS) ld hl,43*256+1 ld (pencol),hl ld hl,end14 ROM_CALL(_VPUTS) ld hl,49*256+1 ld (pencol),hl ld hl,end15 ROM_CALL(_VPUTS) ld hl,55*256+1 ld (pencol),hl ld hl,end16 ROM_CALL(_VPUTS) call long_delay call BUFCOPY ld hl,37*256+1 ld (pencol),hl ld hl,end17 ROM_CALL(_VPUTS) ld hl,43*256+1 ld (pencol),hl ld hl,end18 ROM_CALL(_VPUTS) ld hl,49*256+1 ld (pencol),hl ld hl,end19 ROM_CALL(_VPUTS) ld hl,55*256+1 ld (pencol),hl ld hl,end20 ROM_CALL(_VPUTS) call long_delay call xor_char ld hl,58 ld (xmm),hl ld hl,mmwr ld (curpic),hl call xor_char call BUFCOPY ld hl,37*256+1 ld (pencol),hl ld hl,end21 ROM_CALL(_VPUTS) ld hl,43*256+1 ld (pencol),hl ld hl,end22 ROM_CALL(_VPUTS) ld hl,49*256+1 ld (pencol),hl ld hl,end23 ROM_CALL(_VPUTS) ld hl,55*256+1 ld (pencol),hl ld hl,end24 ROM_CALL(_VPUTS) call long_delay call BUFCOPY ld hl,37*256+1 ld (pencol),hl ld hl,end25 ROM_CALL(_VPUTS) ld hl,43*256+1 ld (pencol),hl ld hl,end26 ROM_CALL(_VPUTS) ld hl,49*256+1 ld (pencol),hl ld hl,end27 ROM_CALL(_VPUTS) ld hl,55*256+1 ld (pencol),hl ld hl,end28 ROM_CALL(_VPUTS) call long_delay call xor_char call xor_boss ld hl,39 ld (xmm),hl ld a,49 ld (xb),a ld hl,mmrl ld (curpic),hl call xor_char call xor_boss call BUFCOPY ld hl,37*256+1 ld (pencol),hl ld hl,end29 ROM_CALL(_VPUTS) ld hl,43*256+1 ld (pencol),hl ld hl,end30 ROM_CALL(_VPUTS) ld hl,49*256+1 ld (pencol),hl ld hl,end31 ROM_CALL(_VPUTS) ld hl,55*256+1 ld (pencol),hl ld hl,end32 ROM_CALL(_VPUTS) call long_delay call BUFCOPY ld hl,37*256+1 ld (pencol),hl ld hl,end33 ROM_CALL(_VPUTS) ld hl,43*256+1 ld (pencol),hl ld hl,end34 ROM_CALL(_VPUTS) ld hl,49*256+1 ld (pencol),hl ld hl,end35 ROM_CALL(_VPUTS) ld hl,55*256+1 ld (pencol),hl ld hl,end36 ROM_CALL(_VPUTS) call long_delay call xor_char ld hl,mmsr ld (curpic),hl call xor_char call BUFCOPY ld hl,37*256+1 ld (pencol),hl ld hl,end37 ROM_CALL(_VPUTS) ld hl,43*256+1 ld (pencol),hl ld hl,end38 ROM_CALL(_VPUTS) ld hl,49*256+1 ld (pencol),hl ld hl,end39 ROM_CALL(_VPUTS) ld hl,55*256+1 ld (pencol),hl ld hl,end40 ROM_CALL(_VPUTS) call long_delay call BUFCOPY ld hl,40*256+13 ld (pencol),hl ld hl,end41 ROM_CALL(_VPUTS) call med_delay ld hl,46*256+13 ld (pencol),hl ld hl,end42 ROM_CALL(_VPUTS) ld hl,52*256+13 ld (pencol),hl ld hl,end43 ROM_CALL(_VPUTS) end_loop: ROM_CALL(_getk) ; go to credits upon keypress cp kMode ; exit if MODE is pressed ret z or a jr z,end_loop ROM_CALL(_clrlcdfull) call BUFCLR ld hl,1*256+1 ld (pencol),hl ld hl,cred1 ROM_CALL(_VPUTS) ld hl,21*256+1 ld (pencol),hl ld hl,cred5 ROM_CALL(_VPUTS) call delay call BUFCOPY ld hl,1*256+1 ld (pencol),hl ld hl,cred2 ROM_CALL(_VPUTS) ld hl,21*256+1 ld (pencol),hl ld hl,cred5 ROM_CALL(_VPUTS) ld hl,31*256+1 ld (pencol),hl ld hl,cred6 ROM_CALL(_VPUTS) call delay call BUFCOPY ld hl,1*256+1 ld (pencol),hl ld hl,cred3 ROM_CALL(_VPUTS) ld hl,21*256+1 ld (pencol),hl ld hl,test1 ROM_CALL(_VPUTS) ld hl,31*256+1 ld (pencol),hl ld hl,test2 ROM_CALL(_VPUTS) ld hl,41*256+1 ld (pencol),hl ld hl,test3 ROM_CALL(_VPUTS) ld hl,51*256+1 ld (pencol),hl ld hl,test4 ROM_CALL(_VPUTS) call delay call BUFCOPY ld hl,1*256+1 ld (pencol),hl ld hl,cred3 ROM_CALL(_VPUTS) ld hl,21*256+1 ld (pencol),hl ld hl,test5 ROM_CALL(_VPUTS) ld hl,31*256+1 ld (pencol),hl ld hl,test6 ROM_CALL(_VPUTS) ld hl,41*256+1 ld (pencol),hl ld hl,test7 ROM_CALL(_VPUTS) ld hl,51*256+1 ld (pencol),hl ld hl,test8 ROM_CALL(_VPUTS) call delay call BUFCOPY ld hl,1*256+1 ld (pencol),hl ld hl,cred3 ROM_CALL(_VPUTS) ld hl,21*256+1 ld (pencol),hl ld hl,test9 ROM_CALL(_VPUTS) ld hl,31*256+1 ld (pencol),hl ld hl,test10 ROM_CALL(_VPUTS) ld hl,41*256+1 ld (pencol),hl ld hl,test11 ROM_CALL(_VPUTS) ld hl,51*256+1 ld (pencol),hl ld hl,test12 ROM_CALL(_VPUTS) call delay call BUFCOPY ld hl,1*256+1 ld (pencol),hl ld hl,cred3 ROM_CALL(_VPUTS) ld hl,21*256+1 ld (pencol),hl ld hl,test13 ROM_CALL(_VPUTS) ld hl,31*256+1 ld (pencol),hl ld hl,test14 ROM_CALL(_VPUTS) ld hl,41*256+1 ld (pencol),hl ld hl,test15 ROM_CALL(_VPUTS) ld hl,51*256+1 ld (pencol),hl ld hl,test16 ROM_CALL(_VPUTS) call delay call BUFCOPY ld hl,1*256+1 ld (pencol),hl ld hl,cred3 ROM_CALL(_VPUTS) ld hl,21*256+1 ld (pencol),hl ld hl,test17 ROM_CALL(_VPUTS) ld hl,31*256+1 ld (pencol),hl ld hl,test18 ROM_CALL(_VPUTS) ld hl,41*256+1 ld (pencol),hl ld hl,test19 ROM_CALL(_VPUTS) ld hl,51*256+1 ld (pencol),hl ld hl,test20 ROM_CALL(_VPUTS) call delay call BUFCOPY ld hl,1*256+1 ld (pencol),hl ld hl,cred4 ROM_CALL(_VPUTS) ld hl,21*256+1 ld (pencol),hl ld hl,cred7 ROM_CALL(_VPUTS) ld hl,31*256+1 ld (pencol),hl ld hl,cred8 ROM_CALL(_VPUTS) ld hl,41*256+1 ld (pencol),hl ld hl,cred9 ROM_CALL(_VPUTS) ld hl,51*256+1 ld (pencol),hl ld hl,cred10 ROM_CALL(_VPUTS) call delay call BUFCOPY ld hl,1*256+1 ld (pencol),hl ld hl,cred4 ROM_CALL(_VPUTS) ld hl,21*256+1 ld (pencol),hl ld hl,cred11 ROM_CALL(_VPUTS) ld hl,31*256+1 ld (pencol),hl ld hl,cred12 ROM_CALL(_VPUTS) ld hl,41*256+1 ld (pencol),hl ld hl,cred13 ROM_CALL(_VPUTS) ld hl,51*256+1 ld (pencol),hl ld hl,cred14 ROM_CALL(_VPUTS) call delay call BUFCOPY ld hl,1*256+1 ld (pencol),hl ld hl,cred4 ROM_CALL(_VPUTS) ld hl,21*256+1 ld (pencol),hl ld hl,cred15 ROM_CALL(_VPUTS) ld hl,31*256+1 ld (pencol),hl ld hl,cred16 ROM_CALL(_VPUTS) ld hl,41*256+1 ld (pencol),hl ld hl,cred17 ROM_CALL(_VPUTS) ld hl,51*256+1 ld (pencol),hl ld hl,cred18 ROM_CALL(_VPUTS) call delay call BUFCOPY ld hl,11*256+10 ld (pencol),hl ld hl,pres ROM_CALL(_VPUTS) ld hl,31*256+20 ld (pencol),hl ld hl,djs ROM_CALL(_VPUTS) cred_loop: ROM_CALL(_getk) ; exit game upon keypress or a jr z,cred_loop ret init_lvlb: ld (curlvl),hl call init_vars ld (schk),a ld (bcount),a call ShowLevel call main_loop ld a,(win) ; see if you defeated TI's spaceship cp 2 jr z,ship_dead ROM_CALL(_getk) ; clear the keybuffer call BUFCLR ROM_CALL(_clrlcdfull) ret init_vars: ld hl,0 ld (xscr),hl ld (tempscr),hl ld hl,8 ; initialize some variables ld (xmm),hl xor a ld (wchk),a ld (wchk1),a ld (wchk2),a ld (wchk3),a ld (win),a ld (death),a ld (feet),a ld (item),a ld (echk),a ld (bwchk),a ld (hchk),a ret ship_dead: ld a,28 ld (enb),a call check_spr call xor_char ld b,0 ; erase ship call ship_init ti_fall: ; TI falls to the bottom of the screen ld a,(yb) inc a ld (yb),a call xor_boss call BUFCOPY call xor_boss ld a,(yb) cp 44 jr nz,ti_fall call check_spr call xor_char ret main_loop: ld a,(hchk) or a call nz,thrown_back ld hl,(xmm) call load_x ld a,(ymm) add a,4 push hl push af call GetBlock call CheckItem pop af pop hl ld de,7 add hl,de call GetBlock call CheckItem ld a,(echk) or a call nz,check_ehitu ld a,(bchk) or a call nz,check_bhitu ld a,(bwchk) or a call nz,check_bwhitu call ShowLevel ld a,(boss) ; draw spaceship if necessary cp 5 ld b,1 call z,ship_init call draw_nrg ; draw energy lines call check_spr ; figure out which Mega Man sprite to use call xor_char ; draw it ld a,(wchk1) ; check if shots should be displayed and display as necessary or a call nz,xor_wpn1 ld a,(wchk2) or a call nz,xor_wpn2 ld a,(wchk3) or a call nz,xor_wpn3 ld a,(echk) ; check for enemy and display as necessary push af cp 1 call z,xor_en pop af cp 2 call z,xor_en ld a,(bwchk) ; check for boss's shot and display as necessary or a call nz,xor_bwpn ld a,(bchk) ; check for boss and display as necessary or a call nz,xor_boss call BUFCOPY ; copy everything to the buffer ld a,(enp) or a call z,die call xor_char ; erase the Megaman sprite ld a,(wchk1) ; check for shots and erase as necessary or a call nz,shot1_move ld a,(wchk2) or a call nz,shot2_move ld a,(wchk3) or a call nz,shot3_move ld a,(echk) ; check for enemy and erase as necessary push af cp 1 call z,i_move pop af cp 2 call z,t_move ld a,(bwchk) ; check for boss's shot and erase as necessary or a call nz,boss_shot_move ld a,(bchk) ; check for boss and erase as necessary or a call nz,boss_move call BUFCLR ld a,(wchk) or a call nz,inc_wchk call find_spr ld a,$FD ; check ENTER out (1),a in a,(1) bit 0,a call z,pause ld a,$FE ; check arrow keys out (1),a in a,(1) bit 1,a call z,move_left bit 2,a call z,move_right ld a,$BF ; check other keys out (1),a in a,(1) bit 4,a call z,sub_screen bit 5,a call z,jump call nz,jchk_now_2 call fall bit 6,a ret z ; exit loop is MODE has been pressed ld a,$DF ; check ALPHA out (1),a in a,(1) bit 7,a call z,shoot ld a,(death) or a ret nz ; exit loop if dead ld a,(win) or a jp z,main_loop ; exit loop if level completed ret pause: call tiny_delay pause_loop: ROM_CALL(_getk) cp kMode ret z cp kEnter jr nz,pause_loop call tiny_delay ret jchk_now_2: ; make sure you can't jump push af ld a,2 ld (jchk),a pop af ret move_right: ld a,(feet) and $02 ld hl,mmrr2 jr nz,rr2_spr ld hl,mmrr rr2_spr: ld (curpic),hl ld a,(xmm) cp 80 call z,won call CheckRight call z,CheckRight2 call z,CheckRight3 jr nz,no_right call change_right ld a,(xmm) cp 44 jr nz,no_scroll ld a,(xscr) cp 68 jr z,no_scroll ld a,(schk) or a jr z,no_scroll call scroll jr no_right no_scroll: ld hl,(xmm) inc hl ld (xmm),hl no_right: ld a,(dir) or a call z,change_right ret change_right: call feet_inc ld a,1 ld (dir),a ret move_left: push af ld a,(feet) and $02 ld hl,mmrl2 jr nz,rl2_spr ld hl,mmrl rl2_spr: ld (curpic),hl ld a,(xmm) or a jr z,no_left call CheckLeft call z,CheckLeft2 call z,CheckLeft3 jr nz,no_left call change_left ld hl,(xmm) dec hl ld (xmm),hl no_left: ld a,(dir) or a call nz,change_left pop af ret change_left: call feet_inc xor a ld (dir),a ret CheckRight: ld hl,(xmm) call load_x ld de,8 add hl,de jr CheckHorz CheckLeft: ld hl,(xmm) call load_x dec hl CheckHorz: ld a,(ymm) call GetBlock call CheckTile ret CheckRight2: ld hl,(xmm) call load_x ld de,8 add hl,de jr CheckHorz2 CheckLeft2: ld hl,(xmm) call load_x dec hl CheckHorz2: ld a,(ymm) add a,11 call GetBlock call CheckTile ret CheckRight3: ld hl,(xmm) call load_x ld de,8 add hl,de jr CheckHorz3 CheckLeft3: ld hl,(xmm) call load_x dec hl CheckHorz3: ld a,(ymm) add a,6 call GetBlock call CheckTile ret GetBlock: ; Gets the block at (HL,A) -> A. HL = addr, B,C = coord srl h rr l srl h rr l srl h rr l ; Divide X with 8 ld b,l cp 64 jr c,OnScreen xor a OnScreen: srl a srl a srl a ; Divide Y with 8 ld c,a add hl,hl add hl,hl add hl,hl ld d,0 ld e,a add hl,de ; HL = x*8+y ld de,(curlvl) add hl,de ; Add HL with the pointer to the level data ld a,(hl) ret CheckTile: or a ret z cp 5 ret c xor a ret CheckItem: cp 5 jr z,got_life cp 6 jr z,got_tank ret got_life: ld a,(item) cp 1 ret nz inc a ld (item),a ld a,(lives) inc a ld (lives),a ret got_tank: ld a,(item) cp 1 ret nz inc a ld (item),a ld a,(tanks) inc a ld (tanks),a ret jump: push af ld a,(jchk) cp 2 jr z,no_jump or a jr nz,jump_up ld a,1 ld (jchk),a ld a,(ymm) sub 10 jr nc,jrem_not0 ld a,1 jrem_not0: ld (jrem),a jump_up: ld a,(jrem) ld b,a ld a,(ymm) cp b jr c,end_jump call CheckUp call z,CheckUp2 jr nz,end_jump ld a,(ymm) dec a ld (ymm),a jr no_jump end_jump: ld a,2 ld (jchk),a no_jump: pop af ret fall: push af ld a,(jchk) cp 1 jr z,no_fall call CheckDown call z,CheckDown2 jr nz,end_fall ld a,(ymm) inc a ld (ymm),a cp 52 call z,die jr no_fall end_fall: xor a ld (jchk),a no_fall: pop af ret CheckUp: ld a,(ymm) dec a jr CheckVert CheckDown: ld a,(ymm) add a,12 CheckVert: ld hl,(xmm) call load_x call GetBlock call CheckTile ret CheckUp2: ld a,(ymm) dec a jr CheckVert2 CheckDown2: ld a,(ymm) add a,12 CheckVert2: ld hl,(xmm) call load_x ld de,7 add hl,de call GetBlock call CheckTile ret shoot_sa: ld a,(xmm) ld (wx1),a ld a,(ymm) add a,4 ld (wy1),a ld a,1 ld (wchk1),a ld a,(enwpn) sub 4 ld (enwpn),a call check_spr call xor_char ret shoot_fr: ld a,(xmm) ld (wx1),a ld a,(ymm) ld (wy1),a call xor_wpn1 ld a,(wy1) add a,4 ld (wy1),a call xor_wpn1 ld a,(wy1) add a,4 ld (wy1),a ld a,1 ld (wchk1),a ld a,(enwpn) sub 4 ld (enwpn),a call check_spr call xor_char ret shoot_md: ld a,(ymm) inc a ld (wy1),a ld a,(dir) or a ld a,(xmm) jr z,smd_left add a,8 jr smd_right smd_left: sub 8 smd_right: ld (wx1),a ld a,1 ld (wchk1),a ld a,(enwpn) sub 4 ld (enwpn),a ret shoot_se: ld a,(bchk) ; restrictions on using top secret weapon or a ret nz ld a,(echk) or a ret z cp 3 ret z ld a,(ymm) cp 26 ret c ld a,(lives) cp 3 ret c ld a,(tanks) cp 4 ret c call won ; effect is beating the current part of the level if requirements are met xor a ld (enwpn),a ret shoot: ld a,(wchk) or a ret nz ld a,(wpn) or a jr z,no_check_enwpn ld a,(enwpn) ; don't shoot if no weapon energy left or a ret z no_check_enwpn: ld a,(dir) ; make sure you aren't too close to edge of screen or a jr z,try_left ld a,(xmm) cp 80 ret nc jr shoot_cont try_left: ld a,(xmm) cp 8 ret c shoot_cont: ld a,(wpn) cp 3 jr z,shoot_md cp 5 jr z,shoot_se cp 7 jp z,shoot_fr cp 8 jp z,shoot_sa ld a,1 ld (wchk),a ld a,(wpn) or a jr z,no_dec_enwpn ld a,(enwpn) dec a ld (enwpn),a no_dec_enwpn: ld a,(wchk1) ; check for bullet #1 or a ; if it doesn't exist, it does now jr z,store_shot1 ld a,(wchk2) ; check for bullet #2 or a ; if it doesn't exist, it does now jr z,store_shot2 ld a,(wchk3) ; check for bullet #3 or a ; if it doesn't exist, it does now ret nz ld a,(ymm) ; initialize shot #3 add a,5 ld (wy3),a ld a,(dir) ld (wdir3),a or a jr z,shoot_left3 ld a,(xmm) add a,8 ld b,a add a,12 jr shoot_init3 shoot_left3: ld a,(xmm) sub 8 ld b,a sub 12 shoot_init3: res 0,a ld (wrem3),a ld a,b ld (wx3),a ld a,1 ld (wchk3),a ret store_shot2: ld a,(ymm) ; initialize shot #2 add a,5 ld (wy2),a ld a,(dir) ld (wdir2),a or a jr z,shoot_left2 ld a,(xmm) add a,8 ld b,a add a,24 jr shoot_init2 shoot_left2: ld a,(xmm) sub 8 ld b,a sub 24 shoot_init2: res 0,a ld (wrem2),a ld a,b ld (wx2),a ld a,1 ld (wchk2),a ret store_shot1: ld a,(ymm) ; initialize shot #1 add a,5 ld (wy1),a ld a,(dir) ld (wdir1),a or a jr z,shoot_left1 ld a,(xmm) add a,8 ld b,a add a,24 jr shoot_init1 shoot_left1: ld a,(xmm) sub 8 ld b,a sub 24 shoot_init1: res 0,a ld (wrem1),a ld a,b ld (wx1),a ld a,1 ld (wchk1),a ret shot3_move: call xor_wpn3 ld a,(xmm) ld b,a ld a,(wx3) cp 4 jr c,sm_end3 cp 87 jr nc,sm_end3 res 0,a cp b jr z,sm_end3 ld b,a ld a,(wpn) cp 1 jr z,sm_short3 cp 2 jr z,sm_short3 cp 6 jr z,sm_short3 sm_cont3: ld a,(wdir3) or a ld a,(wpn) jr z,sm_left3 inc b inc b or a jr z,smr_two3 cp 4 jr z,smr_two3 cp 6 jr z,smr_two3 jr sm_store3 smr_two3: inc b jr sm_store3 sm_left3: dec b dec b or a jr z,sml_two3 cp 4 jr z,sml_two3 cp 6 jr z,sml_two3 sml_two3: dec b sm_store3: ld a,b ld (wx3),a ret sm_short3: ld a,(wrem3) res 0,a sub b jr nz,sm_cont3 ld a,(wpn) cp 6 jr z,sm_chg3 sm_end3: xor a ; shot is off the screen ld (wchk3),a ret sm_chg3: ld a,(wdir3) ; reverse dir shot #3 is moving inc a and $01 ld (wdir3),a jr sm_cont3 shot2_move: call xor_wpn2 ld a,(xmm) ld b,a ld a,(wx2) cp 4 jr c,sm_end2 cp 87 jr nc,sm_end2 res 0,a cp b jr z,sm_end2 ld b,a ld a,(wpn) cp 1 jr z,sm_short2 cp 2 jr z,sm_short2 cp 6 jr z,sm_short2 sm_cont2: ld a,(wdir2) or a ld a,(wpn) jr z,sm_left2 inc b inc b or a jr z,smr_two2 cp 4 jr z,smr_two2 cp 6 jr z,smr_two2 jr sm_store2 smr_two2: inc b jr sm_store2 sm_left2: dec b dec b or a jr z,sml_two2 cp 4 jr z,sml_two2 cp 6 jr z,sml_two2 sml_two2: dec b sm_store2: ld a,b ld (wx2),a ret sm_short2: ld a,(wrem2) res 0,a sub b jr nz,sm_cont2 ld a,(wpn) cp 6 jr z,sm_chg2 sm_end2: xor a ; shot is off the screen ld (wchk2),a ret sm_chg2: ld a,(wdir2) ; reverse dir shot #2 is moving inc a and $01 ld (wdir2),a jr sm_cont2 ssa_move: call check_spr call xor_char ssam_loop: ld a,(wx1) inc a ld (wx1),a call xor_wpn1 call BUFCOPY call xor_wpn1 ld a,(wx1) cp 88 jr nz,ssam_loop ssam_loop2: ld a,(wx1) dec a ld (wx1),a call xor_wpn1 call BUFCOPY call xor_wpn1 ld a,(wx1) or a jr nz,ssam_loop2 ssam_loop3: ld a,(wx1) inc a ld (wx1),a call xor_wpn1 call BUFCOPY call xor_wpn1 ld a,(xmm) ld b,a ld a,(wx1) cp b jr nz,ssam_loop3 xor a ld (wchk1),a ld a,(echk) or a jr z,ssam_bchk cp 3 jr z,ssam_bchk ld a,(ye) ld b,a ld a,(wy1) sub 7 cp b ret nc add a,10 cp b ret c xor a ld a,(ene) or a sub 2 jr nc,sahite_nokill xor a sahite_nokill: ld (ene),a or a ret nz ld a,3 ld (echk),a ret ssam_bchk: ld a,(bchk) or a ret z ld a,(yb) ld b,a ld a,(wy1) sub 11 cp b ret nc add a,14 cp b ret c call dam7_or1 ld a,(enb) or a sub 1 jr nc,sahitb_nokill xor a sahitb_nokill: ld (enb),a ret nz call won ret sfr_move: ld a,(wy1) sub 4 ld (wy1),a call xor_wpn1 ld a,(wy1) sub 4 ld (wy1),a call xor_wpn1 call short_delay xor a ld (wchk1),a call check_spr call xor_char ld a,(echk) or a jr z,sfrm_bchk cp 3 jr z,sfrm_bchk ld a,(xe) ld b,a ld a,(wx1) sub 11 cp b ret nc add a,22 cp b ret c ld a,(ye) ld b,a ld a,(wy1) sub 7 cp b ret nc add a,10 cp b ret c xor a ld a,(ene) or a sub 2 jr nc,frhite_nokill xor a frhite_nokill: ld (ene),a or a ret nz ld a,3 ld (echk),a ret sfrm_bchk: ld a,(bchk) or a ret z ld a,(xb) ld b,a ld a,(wx1) sub 11 cp b ret nc add a,22 cp b ret c ld a,(yb) ld b,a ld a,(wy1) sub 11 cp b ret nc add a,14 cp b ret c call dam7_or1 ld a,(enb) or a sub 1 jr nc,frhitb_nokill xor a frhitb_nokill: ld (enb),a ret nz call won ret smd_move: call short_delay xor a ld (wchk1),a ld a,(echk) or a jr z,smdm_bchk cp 3 jr z,smdm_bchk call xor_en ld a,3 ld (echk),a xor a ld (ecount),a smdm_bchk: ld a,(bchk) or a ret z call dam7_or1 ld a,(enb) or a sub 1 jr nc,mdhitb_nokill xor a mdhitb_nokill: ld (enb),a ret nz call won ret shot1_move: call xor_wpn1 ld a,(wpn) cp 3 jr z,smd_move cp 7 jp z,sfr_move cp 8 jp z,ssa_move ld a,(xmm) ld b,a ld a,(wx1) cp 4 jr c,sm_end1 cp 87 jr nc,sm_end1 res 0,a cp b jr z,sm_end1 ld b,a ld a,(wpn) cp 1 jr z,sm_short1 cp 2 jr z,sm_short1 cp 6 jr z,sm_short1 sm_cont1: ld a,(wdir1) or a ld a,(wpn) jr z,sm_left1 inc b inc b or a jr z,smr_two1 cp 4 jr z,smr_two1 cp 6 jr z,smr_two1 jr sm_store1 smr_two1: inc b jr sm_store1 sm_left1: dec b dec b or a jr z,sml_two1 cp 4 jr z,sml_two1 cp 6 jr z,sml_two1 sml_two1: dec b sm_store1: ld a,b ld (wx1),a ret sm_short1: ld a,(wrem1) res 0,a sub b jr nz,sm_cont1 ld a,(wpn) cp 6 jr z,sm_chg1 sm_end1: xor a ; shot is off the screen ld (wchk1),a ret sm_chg1: ld a,(wdir1) ; reverse dir shot #1 is moving inc a and $01 ld (wdir1),a jr sm_cont1 inc_wchk: ; lets you shoot again inc a cp 8 jr nz,keep_wchk xor a keep_wchk: ld (wchk),a ret die: call short_delay ld a,(lives) dec a ld (lives),a ld a,1 ld (death),a ret won: ld a,1 ld (win),a ld a,(bchk) ; check for boss or a ret z ld a,(boss) ; see if that boss was the spaceship cp 5 ret nz ld a,2 ; if so, set win=2 ld (win),a ret s1_dec: ld a,(wx1) dec a ld (wx1),a ld a,(wrem1) dec a ld (wrem1),a ret s2_dec: ld a,(wx2) dec a ld (wx2),a ld a,(wrem2) dec a ld (wrem2),a ret s3_dec: ld a,(wx3) dec a ld (wx3),a ld a,(wrem3) dec a ld (wrem3),a ret scroll: call BUFCLR ld a,(tempscr) inc a cp 8 jr nz,scroll_cont ld a,(xscr) inc a ld (xscr),a xor a scroll_cont: ld (tempscr),a ld a,(wchk1) or a call nz,s1_dec ld a,(wchk2) or a call nz,s2_dec ld a,(wchk3) or a call nz,s3_dec ld a,(echk) or a call nz,next_en ld a,(echk) or a ret z cp 3 ret z ld a,(xe) ; decrease x-coord of enemy dec a ld (xe),a or a call z,en_dead ret ShowLevel: ld hl,(xscr) add hl,hl add hl,hl add hl,hl push hl pop de ld hl,(curlvl) add hl,de ld bc,0 RepShowLevel: ; displays the current full screen of the level ld a,(hl) cp 5 call nc,item_init inc hl push hl ld h,0 ld l,a add hl,hl add hl,hl add hl,hl ld de,lvlspr add hl,de push bc ld a,(tempscr) ld d,a ld a,b sub d jr c,skip_8x8 ld (x2),a ld a,c ld (y2),a ld (smlspr),hl call xor_8x8 skip_8x8: pop bc pop hl ld a,c add a,8 ld c,a cp 64 jr nz,RepShowLevel ld c,0 ld a,b add a,8 ld b,a cp 96 jr nz,RepShowLevel ret item_init: ld d,a cp 7 jr nc,t_init ld a,(item) cp 2 jr z,no_item_init ld a,1 ld (item),a ld a,d ret no_item_init: xor a ; replace item sprite with blank sprite ret t_init: ld a,(echk) ; check for existing enemy or a jr nz,no_en_init ld hl,iup ; initialize enemy variables xor a ld (edir),a ld (ecount),a ld (ecount2),a inc a inc a ld (ene),a ld a,d cp 9 ld a,1 jr z,i_init ld a,3 ld (ene),a dec a ld hl,tleft i_init: ld (echk),a ld (enspr),hl ld a,b ld (xe),a ld a,c ld (ye),a no_en_init: xor a ; replace enemy sprite with blank sprite ret load_x: ; loads x location (input as hl) into hl, accounting for scrolling push hl ld hl,(xscr) add hl,hl add hl,hl add hl,hl pop de add hl,de push hl ld hl,(tempscr) pop de add hl,de ret feet_inc: ; feet changes from 0 to 1 to 2 to 3 to 0 ld a,(feet) inc a cp 4 jr nz,store_feet xor a store_feet: ld (feet),a ret sub_screen: push af ROM_CALL(_clrlcdfull) call BUFCLR call tiny_delay xor a ld (wchk1),a ld (wchk2),a ld (wchk3),a ld a,(wpn) or a jr z,ss_cont cp 1 jr z,en_an cp 2 jr z,en_ma cp 3 jr z,en_md cp 4 jr z,en_do cp 5 jr z,en_se cp 6 jr z,en_po cp 7 jr z,en_fr cp 8 jr z,en_sa cp 9 jr z,en_mi en_an: ld a,(enwpn) ld (enan),a jr ss_cont en_ma: ld a,(enwpn) ld (enma),a jr ss_cont en_md: ld a,(enwpn) ld (enmd),a jr ss_cont en_do: ld a,(enwpn) ld (endo),a jr ss_cont en_se: ld a,(enwpn) ld (ense),a jr ss_cont en_po: ld a,(enwpn) ld (enpo),a jr ss_cont en_fr: ld a,(enwpn) ld (enfr),a jr ss_cont en_sa: ld a,(enwpn) ld (ensa),a jr ss_cont en_mi: ld a,(enwpn) ld (enmi),a ss_cont: ld a,28 ld (x2),a ld a,53 ld (y2),a ld hl,tank ld (smlspr),hl call xor_8x8 ld a,55 ld (x2),a ld hl,head ld (smlspr),hl call xor_8x8 ld d,0 ld e,0 ld h,94 ld l,0 ld b,1 call FLine ld e,62 ld l,62 call FLine ld e,51 ld l,51 call FLine ld e,50 ld l,50 call FLine ld d,94 ld e,62 ld l,0 call FLine ld d,0 ld h,0 call FLine ld d,47 ld h,47 call FLine xor a ld (x2),a inc a ld (y2),a ld hl,pwdot ld (smlspr),hl ss_loop_new: call xor_8x8 call BUFCOPY ld a,(lvldone) bit 0,a jr z,ss_line1 ld d,16 ld e,15 push af ld a,(enan) add a,17 ld h,a ld l,15 ld b,1 call FLine pop af ss_line1: bit 1,a jr z,ss_line2 ld d,16 ld e,25 push af ld a,(enma) add a,17 ld h,a ld l,25 ld b,1 call FLine pop af ss_line2: bit 2,a jr z,ss_line3 ld d,16 ld e,35 push af ld a,(enmd) add a,17 ld h,a ld l,35 ld b,1 call FLine pop af ss_line3: bit 3,a jr z,ss_line4 ld d,16 ld e,45 push af ld a,(endo) add a,17 ld h,a ld l,45 ld b,1 call FLine pop af ss_line4: bit 4,a jr z,ss_line5 ld d,63 ld e,15 push af ld a,(enpo) add a,64 ld h,a ld l,15 ld b,1 call FLine pop af ss_line5: bit 5,a jr z,ss_line6 ld d,63 ld e,5 push af ld a,(ense) add a,64 ld h,a ld l,5 ld b,1 call FLine ld d,63 ld e,25 ld a,(enfr) add a,64 ld h,a ld l,25 ld b,1 call FLine pop af ss_line6: bit 6,a jr z,ss_line7 ld d,63 ld e,35 push af ld a,(ensa) add a,64 ld h,a ld l,35 ld b,1 call FLine pop af ss_line7: bit 7,a jr z,ss_line_done ld d,63 ld e,45 ld a,(enmi) add a,64 ld h,a ld l,45 ld b,1 call FLine ss_line_done: ld d,16 ld e,5 ld a,(enp) add a,17 ld h,a ld l,5 ld b,1 call FLine call BUFCOPY ld a,(lvldone) bit 0,a jr z,ss_bit1 ld hl,12*256+7 ld (pencol),hl ld hl,an ROM_CALL(_VPUTS) ss_bit1: bit 1,a jr z,ss_bit2 ld hl,22*256+7 ld (pencol),hl ld hl,ma ROM_CALL(_VPUTS) ss_bit2: bit 2,a jr z,ss_bit3 ld hl,32*256+7 ld (pencol),hl ld hl,md ROM_CALL(_VPUTS) ss_bit3: bit 3,a jr z,ss_bit4 ld hl,42*256+7 ld (pencol),hl ld hl,do ROM_CALL(_VPUTS) ss_bit4: bit 4,a jr z,ss_bit5 ld hl,12*256+54 ld (pencol),hl ld hl,po ROM_CALL(_VPUTS) ss_bit5: bit 5,a jr z,ss_bit6 ld hl,22*256+54 ld (pencol),hl ld hl,fr ROM_CALL(_VPUTS) ld hl,2*256+54 ld (pencol),hl ld hl,se ROM_CALL(_VPUTS) ss_bit6: bit 6,a jr z,ss_bit7 ld hl,32*256+54 ld (pencol),hl ld hl,sa ROM_CALL(_VPUTS) ss_bit7: bit 7,a jr z,ss_loop_init ld hl,42*256+54 ld (pencol),hl ld hl,mi ROM_CALL(_VPUTS) ss_loop_init: ld hl,2*256+7 ld (pencol),hl ld hl,p ROM_CALL(_VPUTS) ld a,(tanks) call _setxxop1 ld hl,54*256+40 ld (pencol),hl ld a,1 call _dispop1a ld a,(lives) call _setxxop1 ld hl,54*256+67 ld (pencol),hl ld a,1 call _dispop1a call xor_8x8 ss_loop: ROM_CALL(_getk) cp kUp jp z,ss_up cp kDown jp z,ss_down cp kLeft jp z,ss_horz cp kRight jp z,ss_horz cp k2nd jp z,ss_tank cp kMode jp z,ss_mode cp kYEq jr nz,ss_loop ld hl,wpp ld a,(lvldone) ld b,a ld a,(x2) or a ld a,(y2) jr z,wpn_left cp 1 jr z,ss_se cp 11 jp z,ss_po cp 21 jp z,ss_fr cp 31 jp z,ss_sa jp ss_mi wpn_left: ld c,0 ld hl,wpp cp 1 jp z,ss_exit cp 11 jr z,ss_an cp 21 jr z,ss_ma cp 31 jr z,ss_md jr ss_do ss_an: bit 0,b jr z,ss_loop ld c,1 ld a,(enan) ld (enwpn),a ld hl,wpan jp ss_exit ss_ma: bit 1,b jr z,ss_loop ld c,2 ld a,(enma) ld (enwpn),a ld hl,wpma jr ss_exit ss_md: bit 2,b jp z,ss_loop ld c,3 ld a,(enmd) ld (enwpn),a ld hl,wpmd jr ss_exit ss_do: bit 3,b jp z,ss_loop ld c,4 ld a,(endo) ld (enwpn),a ld hl,wpdo jr ss_exit ss_se: bit 5,b jp z,ss_loop ld c,5 ld a,(ense) ld (enwpn),a ld hl,wpse jr ss_exit ss_po: bit 4,b jp z,ss_loop ld c,6 ld a,(enpo) ld (enwpn),a ld hl,wppo jr ss_exit ss_fr: bit 5,b jp z,ss_loop ld c,7 ld a,(enfr) ld (enwpn),a ld hl,wpfr jr ss_exit ss_sa: bit 6,b jp z,ss_loop ld c,8 ld a,(ensa) ld (enwpn),a ld hl,wpsa jr ss_exit ss_mi: bit 7,b jp z,ss_loop ld c,9 ld a,(enmi) ld (enwpn),a ld hl,wpmi ss_exit: ld a,c ld (wpn),a ld (wpnspr),hl ROM_CALL(_clrlcdfull) call BUFCLR call ShowLevel pop af call tiny_delay ret ss_mode: pop bc ; pop to something other than af so it remembers that MODE has been pressed ret ss_up: ld a,(y2) cp 1 jr z,ss_vert sub 10 ld (y2),a jp ss_loop_new ss_down: ld a,(y2) cp 41 jr z,ss_vert add a,10 ld (y2),a jp ss_loop_new ss_vert: ld b,a ld a,42 sub b ld (y2),a jp ss_loop_new ss_horz: ld a,(x2) ld b,a ld a,47 sub b ld (x2),a jp ss_loop_new ss_tank: ld a,(tanks) or a jp z,ss_loop_new dec a ld (tanks),a ld a,28 ld (enp),a jp ss_loop_new xor_char: ld hl,(curpic) ld c,12 ld a,(ymm) ld e,a ld a,(xmm) call SPRXOR ret check_spr: ld a,(dir) or a jr z,check_spr_l check_spr_r: ld hl,mmhr ld a,(hchk) or a jr nz,found_spr ld a,(ymm) add a,12 call CheckVert jr c,not_jump_r ld hl,mmjr ld a,(jchk) or a jr nz,found_spr not_jump_r: ld hl,mmwr ld a,(wchk) or a jr nz,found_spr ret check_spr_l: ld hl,mmhl ld a,(hchk) or a jr nz,found_spr ld a,(ymm) add a,12 call CheckVert jr c,not_jump_l ld hl,mmjl ld a,(jchk) or a jr nz,found_spr not_jump_l: ld hl,mmwl ld a,(wchk) or a jr nz,found_spr ret found_spr: ld (curpic),hl ret find_spr: ld a,(dir) or a jr z,left_spr ld hl,mmsr jr found_spr left_spr: ld hl,mmsl jr found_spr t_move: call xor_en call check_en_dist ld a,(edir) or a ld a,(xe) jr z,t_move_l inc a jr t_move_r t_move_l: dec a or a call z,en_dead t_move_r: ld (xe),a ret i_move: call xor_en call check_en_dist ld a,(edir) or a ld a,(ye) jr z,i_move_u inc a jr i_move_d i_move_u: dec a i_move_d: ld (ye),a ret ti_check: ld a,(echk) cp 3 jr nz,tic_cont xor a ld (echk),a tic_cont: ld b,46 ld c,46 ld a,(bcount) inc a ld (bcount),a cp 50 ld a,7 call z,item_init ld a,(bcount) cp 100 ld a,9 call z,item_init ld a,(bcount) cp 100 ret nz xor a ld (bcount),a ret ship_check: ld a,(bcount) inc a cp 50 jr z,ship_laser ld (bcount),a ret ship_laser: xor a ld (bcount),a ld b,1 call xor_laser call short_delay ld a,(ymm) cp 38 call c,die ld b,0 call xor_laser ret boss_move: call xor_boss ld a,(boss) or a jr z,ti_check cp 5 jr z,ship_check ld a,(bjchk) or a jr nz,boss_jump ld a,(bdir) or a ld a,(xb) jr z,boss_move_l inc a cp 76 jr boss_move_r boss_move_l: dec a cp 56 boss_move_r: ld (xb),a jr z,boss_turn cp 66 call z,boss_shoot ret boss_turn: ld a,(bdir) ; reverse dir boss is moving ld b,a ld a,1 sub b ld (bdir),a ld a,2 ld (bjchk),a ret boss_jump: ld a,(bjchk) cp 1 ld a,(yb) jr z,boss_fall dec a cp 34 jr boss_jump_end boss_fall: inc a cp 44 boss_jump_end: ld (yb),a ret nz ld a,(bjchk) dec a ld (bjchk),a ret bshoot_sa: ld a,(xb) ld (bwx),a call xor_boss ret bshoot_fr: ld a,(xb) ld (bwx),a ret bshoot_md: ld a,(xb) sub 8 ld (bwx),a ret boss_shoot: ld a,(bwchk) or a ret nz inc a ld (bwchk),a ld a,(boss) cp 3 jr z,bshoot_md cp 7 jr z,bshoot_fr cp 8 jr z,bshoot_sa ld a,58 ld (bwx),a ret bssa_move: call xor_boss call check_spr call xor_char bssam_loop: ld a,(bwx) dec a ld (bwx),a call xor_bwpn call BUFCOPY call xor_bwpn ld a,(bwx) or a jr nz,bssam_loop bssam_loop2: ld a,(bwx) inc a ld (bwx),a call xor_bwpn call BUFCOPY call xor_bwpn ld a,(bwx) cp 88 jr nz,bssam_loop2 bssam_loop3: ld a,(bwx) dec a ld (bwx),a call xor_bwpn call BUFCOPY call xor_bwpn ld a,(xb) ld b,a ld a,(bwx) cp b jr nz,bssam_loop3 xor a ld (bwchk),a call check_spr call xor_char ld a,(ymm) ld b,a ld a,37 cp b ret nc add a,16 cp b ret c ld a,(enp) or a sub 4 jr nc,bssam_nokill xor a bssam_nokill: ld (enp),a ret bsfr_move: call check_spr call xor_char call xor_boss call xor_bwpn call BUFCOPY call xor_char call xor_boss call xor_bwpn call short_delay xor a ld (bwchk),a ld a,(xmm) ld b,a ld a,55 cp b ret nc add a,22 cp b ret c ld a,(ymm) ld b,a ld a,33 cp b ret nc add a,11 cp b ret c ld a,(enp) or a sub 4 jr nc,bsfrm_nokill xor a bsfrm_nokill: ld (enp),a ret bsmd_move: call short_delay ld a,(enp) or a sub 4 jr nc,bsmdm_nokill xor a bsmdm_nokill: ld (enp),a xor a ld (bwchk),a ret boss_shot_move: call xor_bwpn ld a,(boss) cp 8 jp z,bssa_move cp 3 jr z,bsmd_move cp 7 jr z,bsfr_move ld a,(xb) ld b,a ld a,(bwx) cp 2 jr c,bsm_end cp b jr z,bsm_end ld b,a bsm_cont: dec b dec b ld a,(boss) cp 4 jr nz,bsm_store dec b bsm_store: ld a,b ld (bwx),a ret bsm_end: xor a ; boss's shot is off the screen ld (bwchk),a ret check_en_dist: ; check distance enemy has moved and turn around if necessary ld a,(ecount) inc a cp 33 call z,en_turn ld (ecount),a ret en_turn: ld hl,(enspr) ld de,8 ld a,(edir) or a jr z,en_turn_r sbc hl,de dec a jr en_turn_l en_turn_r: add hl,de inc a en_turn_l: ld (enspr),hl ld (edir),a xor a ret en_dead: ; enemy is now dead ld a,3 ld (echk),a xor a ld (ecount),a ret next_en: ; check if previous enemy is clear so next enemy can initialize ld a,(ecount2) inc a ld (ecount2),a cp 96 ret nz xor a ld (echk),a ret xor_en: ld hl,(enspr) ld c,8 ld a,(ye) ld e,a ld a,(xe) call SPRXOR ret xor_corners: ld hl,uprlft ld (smlspr),hl call xor_8x8 ld a,(x2) add a,22 ld (x2),a ld hl,uprrt ld (smlspr),hl call xor_8x8 ld a,(y2) add a,12 ld (y2),a ld hl,lwrrt ld (smlspr),hl call xor_8x8 ld a,(x2) sub 22 ld (x2),a ld hl,lwrlft ld (smlspr),hl call xor_8x8 ld a,(y2) sub 12 ld (y2),a ret xor_8x8: ld c,8 ld a,(y2) ld e,a ld a,(x2) ld hl,(smlspr) call SPRXOR ret xor_wpn1: ld c,4 ld a,(wy1) ld e,a ld a,(wx1) ld hl,(wpnspr) call SPRXOR ret xor_wpn2: ld c,4 ld a,(wy2) ld e,a ld a,(wx2) ld hl,(wpnspr) call SPRXOR ret xor_wpn3: ld c,4 ld a,(wy3) ld e,a ld a,(wx3) ld hl,(wpnspr) call SPRXOR ret xor_bwpn: ld c,4 ld e,49 ld a,(bwx) ld hl,(bwspr) call SPRXOR ret tiny_delay: ld b,20 jr del_loop short_delay: ld b,50 jr del_loop long_delay: call delay med_delay: ld b,100 jr del_loop delay: ld b,200 del_loop: halt halt djnz del_loop ret disp_boss: ld (bosspic),hl ROM_CALL(_clrlcdfull) call BUFCLR xor a ld (x2),a ld a,16 ld (y2),a ld hl,bint ld (smlspr),hl ld b,12 draw1: push bc call xor_8x8 ld a,(x2) add a,8 ld (x2),a pop bc djnz draw1 ld a,0 ld (x2),a ld a,40 ld (y2),a ld hl,bint ld (smlspr),hl ld b,12 draw2: push bc call xor_8x8 ld a,(x2) add a,8 ld (x2),a pop bc djnz draw2 call xor_boss call BUFCOPY ret xor_boss: ld c,12 ld a,(yb) ld e,a ld a,(xb) ld hl,(bosspic) call SPRXOR ret no_an: ld d,2 ld e,1 ld h,31 ld l,20 ld b,1 call FLine ld e,20 ld l,1 call FLine ret no_ma: ld d,33 ld e,1 ld h,62 ld l,21 ld b,1 call FLine ld e,21 ld l,1 call FLine ret no_md: ld d,64 ld e,1 ld h,93 ld l,21 ld b,1 call FLine ld e,20 ld l,1 call FLine ret no_do: ld d,2 ld e,22 ld h,31 ld l,41 ld b,1 call FLine ld e,41 ld l,22 call FLine ret no_po: ld d,64 ld e,22 ld h,93 ld l,41 ld b,1 call FLine ld e,41 ld l,22 call FLine ret no_fr: ld d,2 ld e,43 ld h,31 ld l,62 ld b,1 call FLine ld e,62 ld l,43 call FLine ret no_sa: ld d,33 ld e,43 ld h,62 ld l,62 ld b,1 call FLine ld e,62 ld l,43 call FLine ret no_mi: ld d,64 ld e,43 ld h,93 ld l,62 ld b,1 call FLine ld e,62 ld l,43 call FLine ret you_got: ROM_CALL(_clrlcdfull) call BUFCLR ld d,0 ld e,0 ld h,94 ld l,0 ld b,1 call FLine ld e,62 ld l,62 call FLine ld e,43 ld l,43 call FLine ld d,94 ld e,62 ld l,0 call FLine ld d,0 ld h,0 call FLine ld hl,35 ld (xmm),hl ld a,50 ld (ymm),a ld hl,mmsr ld (curpic),hl ld a,43 ld (wx1),a ld a,51 ld (wy1),a ld a,(boss) ld hl,wpmd cp 3 jr z,yg_cont ld hl,mmwr ld (curpic),hl ld a,55 ld (wx1),a ld a,55 ld (wy1),a ld a,(boss) ld hl,wpan cp 1 jr z,yg_cont ld hl,wpma cp 2 jr z,yg_cont ld hl,wpdo cp 4 jr z,yg_cont ld hl,wppo cp 6 jr z,yg_cont cp 9 ld hl,wpmi jr z,yg_cont push af ld a,35 ld (wx1),a ld a,54 ld (wy1),a call xor_char pop af ld hl,wpsa cp 8 jr z,yg_cont ld hl,wpfr ld (wpnspr),hl call xor_wpn1 ld a,50 ld (wy1),a call xor_wpn1 ld a,58 ld (wy1),a ld hl,wpfr yg_cont: ld (wpnspr),hl call xor_wpn1 call xor_char call BUFCOPY ld hl,10*256+35 ld (pencol),hl ld hl,yougot ROM_CALL(_VPUTS) ld a,(boss) cp 1 jr z,yg_an cp 2 jr z,yg_ma cp 3 jr z,yg_md cp 4 jr z,yg_do cp 6 jr z,yg_po cp 7 jr z,yg_fr cp 8 jp z,yg_sa jp yg_mi yg_an: ld hl,20*256+28 ld (pencol),hl ld hl,ygan ROM_CALL(_VPUTS) jp yg_loop yg_ma: ld hl,20*256+25 ld (pencol),hl ld hl,ygma ROM_CALL(_VPUTS) jr yg_loop yg_md: ld hl,20*256+20 ld (pencol),hl ld hl,ygmd ROM_CALL(_VPUTS) jr yg_loop yg_do: ld hl,20*256+26 ld (pencol),hl ld hl,ygdo ROM_CALL(_VPUTS) jr yg_loop yg_po: ld hl,20*256+18 ld (pencol),hl ld hl,ygpo ROM_CALL(_VPUTS) jr yg_loop yg_fr: ld hl,20*256+31 ld (pencol),hl ld hl,ygfr ROM_CALL(_VPUTS) ld hl,30*256+12 ld (pencol),hl ld hl,ygse ROM_CALL(_VPUTS) ld hl,53*256+55 ld (pencol),hl ld hl,se ROM_CALL(_VPUTS) jr yg_loop yg_sa: ld hl,20*256+28 ld (pencol),hl ld hl,ygsa ROM_CALL(_VPUTS) jr yg_loop yg_mi: ld hl,20*256+28 ld (pencol),hl ld hl,ygmi ROM_CALL(_VPUTS) yg_loop: ROM_CALL(_getk) cp kMode ret z cp kEnter jr nz,yg_loop ret draw_grid: ROM_CALL(_clrlcdfull) call BUFCLR ld d,28 ld e,9 ld h,73 ld l,9 ld b,1 call FLine ld e,18 ld l,18 call FLine ld e,27 ld l,27 call FLine ld e,36 ld l,36 call FLine ld e,45 ld l,45 call FLine ld e,54 ld l,54 call FLine ld h,28 ld l,10 call FLine ld d,37 ld h,37 call FLine ld d,46 ld h,46 call FLine ld d,55 ld h,55 call FLine ld d,64 ld h,64 call FLine ld d,73 ld h,73 call FLine ret pw_text: ld hl,1*256+31 ld (pencol),hl ld hl,one ROM_CALL(_VPUTS) ld hl,1*256+40 ld (pencol),hl ld hl,two ROM_CALL(_VPUTS) ld hl,1*256+49 ld (pencol),hl ld hl,three ROM_CALL(_VPUTS) ld hl,1*256+58 ld (pencol),hl ld hl,four ROM_CALL(_VPUTS) ld hl,1*256+67 ld (pencol),hl ld hl,five ROM_CALL(_VPUTS) ld hl,10*256+23 ld (pencol),hl ld hl,a ROM_CALL(_VPUTS) ld hl,19*256+23 ld (pencol),hl ld hl,b ROM_CALL(_VPUTS) ld hl,28*256+23 ld (pencol),hl ld hl,c ROM_CALL(_VPUTS) ld hl,37*256+23 ld (pencol),hl ld hl,d ROM_CALL(_VPUTS) ld hl,46*256+23 ld (pencol),hl ld hl,e ROM_CALL(_VPUTS) ld hl,56*256+32 ld (pencol),hl ld hl,enter ROM_CALL(_VPUTS) ret show_pw: call draw_grid ld a,(tanks) ; find correct password dot for number of tanks ld b,1 or a jr z,spw_cont ld b,2 cp 1 jr z,spw_cont ld b,4 cp 2 jr z,spw_cont ld b,8 cp 3 jr z,spw_cont ld b,16 spw_cont: ld a,b ld (tankpw),a ld hl,pwdot ld (smlspr),hl ld a,(lvldone) bit 0,a jr z,no_an_dot ld a,28 jr an_dot no_an_dot: ld a,46 an_dot: ld (y2),a ld a,47 ld (x2),a call xor_8x8 ld a,(lvldone) bit 1,a jr z,no_ma_dot ld a,10 ld (y2),a ld a,38 jr ma_dot no_ma_dot: ld a,28 ld (y2),a ld a,65 ma_dot: ld (x2),a call xor_8x8 ld a,(lvldone) bit 2,a jr z,no_md_dot ld a,46 ld (y2),a ld a,65 jr md_dot no_md_dot: ld a,10 ld (y2),a ld a,56 md_dot: ld (x2),a call xor_8x8 ld a,(lvldone) bit 3,a jr z,no_do_dot ld a,37 ld (y2),a ld a,47 jr do_dot no_do_dot: ld a,46 ld (y2),a ld a,38 do_dot: ld (x2),a call xor_8x8 ld a,(lvldone) bit 4,a jr z,no_po_dot ld a,37 ld (y2),a ld a,29 jr po_dot no_po_dot: ld a,19 ld (y2),a ld a,65 po_dot: ld (x2),a call xor_8x8 ld a,(lvldone) bit 5,a jr z,no_fr_dot ld a,56 jr fr_dot no_fr_dot: ld a,29 fr_dot: ld (x2),a ld a,19 ld (y2),a call xor_8x8 ld a,(lvldone) bit 5,a jr z,no_se_dot ld a,46 ld (y2),a ld a,29 jr se_dot no_se_dot: ld a,28 ld (y2),a ld a,56 se_dot: ld (x2),a call xor_8x8 ld a,(lvldone) bit 6,a jr z,no_sa_dot ld a,38 jr sa_dot no_sa_dot: ld a,47 sa_dot: ld (x2),a ld a,19 ld (y2),a call xor_8x8 ld a,(lvldone) bit 7,a jr z,no_mi_dot ld a,28 ld (y2),a ld a,38 jr mi_dot no_mi_dot: ld a,37 ld (y2),a ld a,56 mi_dot: ld (x2),a call xor_8x8 tank_dot: ld a,(tankpw) ld b,a ld a,10 ld (y2),a ld a,47 ld (x2),a bit 0,b jr nz,tank_dot_found ld a,46 ld (y2),a ld a,56 ld (x2),a bit 1,b jr nz,tank_dot_found ld a,28 ld (y2),a ld a,29 ld (x2),a bit 2,b jr nz,tank_dot_found ld a,10 ld (y2),a ld a,65 ld (x2),a bit 3,b jr nz,tank_dot_found ld a,37 ld (y2),a ld a,38 ld (x2),a tank_dot_found: call xor_8x8 call BUFCOPY call pw_text show_pw_loop: ROM_CALL(_getk) cp kMode ret z cp kEnter jr nz,show_pw_loop ret enter_pw: xor a ld (anpw),a ld (mapw),a ld (mdpw),a ld (dopw),a ld (popw),a ld (frpw),a ld (sepw),a ld (sapw),a ld (mipw),a ld (tankpw),a call draw_grid ld hl,pwcurs ld (smlspr),hl ld a,10 ld (y2),a ld a,29 ld (x2),a ep_loop_new: call xor_8x8 call BUFCOPY call pw_text call xor_8x8 ep_loop: ROM_CALL(_getk) cp kLeft jr z,ep_left cp kRight jr z,ep_right cp kUp jr z,ep_up cp kDown jr z,ep_down cp k2nd jr z,ep_dot cp kEnter jp z,check_pw cp kMode ret z jr ep_loop ep_left: ld a,(x2) cp 29 jr z,ep_horz sub 9 ld (x2),a jr ep_loop_new ep_right: ld a,(x2) cp 65 jr z,ep_horz add a,9 ld (x2),a jr ep_loop_new ep_horz: ld b,a ld a,94 sub b ld (x2),a jr ep_loop_new ep_up: ld a,(y2) cp 10 jr z,ep_vert sub 9 ld (y2),a jr ep_loop_new ep_down: ld a,(y2) cp 46 jr z,ep_vert add a,9 ld (y2),a jr ep_loop_new ep_vert: ld b,a ld a,56 sub b ld (y2),a jr ep_loop_new ep_dot: ld hl,pwdot ld (smlspr),hl call xor_8x8 ld hl,pwcurs ld (smlspr),hl ld a,(y2) cp 10 jr z,rowa cp 19 jr z,rowb cp 28 jp z,rowc cp 37 jp z,rowd jp rowe rowa: ld a,(x2) cp 29 jr z,rowa_col1 cp 38 jr z,rowa_col2 cp 47 jr z,rowa_col3 cp 56 jr z,rowa_col4 jr rowa_col5 rowa_col1: ld a,(tankpw) bit 5,a set 5,a jp z,tankpw_done res 5,a jp tankpw_done rowa_col2: ld a,(mapw) bit 1,a set 1,a jr z,mapw_done res 1,a mapw_done: ld (mapw),a jp ep_loop_new rowa_col3: ld a,(tankpw) bit 0,a set 0,a jp z,tankpw_done res 0,a jp tankpw_done rowa_col4: ld a,(mdpw) bit 0,a set 0,a jr z,mdpw_done res 0,a mdpw_done: ld (mdpw),a jp ep_loop_new rowa_col5: ld a,(tankpw) bit 3,a set 3,a jp z,tankpw_done res 3,a jp tankpw_done rowb: ld a,(x2) cp 29 jr z,rowb_col1 cp 38 jr z,rowb_col2 cp 47 jr z,rowb_col3 cp 56 jr z,rowb_col4 jr rowb_col5 rowb_col1: ld a,(frpw) bit 0,a set 0,a jr z,frpw_done res 0,a frpw_done: ld (frpw),a jp ep_loop_new rowb_col2: ld a,(sapw) bit 1,a set 1,a jr z,sapw_done res 1,a sapw_done: ld (sapw),a jp ep_loop_new rowb_col3: ld a,(sapw) bit 0,a set 0,a jr z,sapw_done res 0,a jr sapw_done rowb_col4: ld a,(frpw) bit 1,a set 1,a jr z,frpw_done res 1,a jr frpw_done rowb_col5: ld a,(popw) bit 0,a set 0,a jr z,popw_done res 0,a popw_done: ld (popw),a jp ep_loop_new rowc: ld a,(x2) cp 29 jr z,rowc_col1 cp 38 jr z,rowc_col2 cp 47 jr z,rowc_col3 cp 56 jr z,rowc_col4 jr rowc_col5 rowc_col1: ld a,(tankpw) bit 2,a set 2,a jr z,tankpw_done res 2,a tankpw_done: ld (tankpw),a jp ep_loop_new rowc_col2: ld a,(mipw) bit 1,a set 1,a jr z,mipw_done res 1,a mipw_done: ld (mipw),a jp ep_loop_new rowc_col3: ld a,(anpw) bit 1,a set 1,a jp z,anpw_done res 1,a jp anpw_done rowc_col4: ld a,(sepw) bit 0,a set 0,a jp z,sepw_done res 0,a jp sepw_done rowc_col5: ld a,(mapw) bit 0,a set 0,a jp z,mapw_done res 0,a jp mapw_done rowd: ld a,(x2) cp 29 jr z,rowd_col1 cp 38 jr z,rowd_col2 cp 47 jr z,rowd_col3 cp 56 jr z,rowd_col4 jr rowd_col5 rowd_col1: ld a,(popw) bit 1,a set 1,a jp z,popw_done res 1,a jp popw_done rowd_col2: ld a,(tankpw) bit 4,a set 4,a jr z,tankpw_done res 4,a jr tankpw_done rowd_col3: ld a,(dopw) bit 1,a set 1,a jr z,dopw_done res 1,a dopw_done: ld (dopw),a jp ep_loop_new rowd_col4: ld a,(mipw) bit 0,a set 0,a jr z,mipw_done res 0,a jp mipw_done rowd_col5: ld a,(tankpw) bit 6,a set 6,a jp z,tankpw_done res 6,a jp tankpw_done rowe: ld a,(x2) cp 29 jr z,rowe_col1 cp 38 jr z,rowe_col2 cp 47 jr z,rowe_col3 cp 56 jr z,rowe_col4 jr rowe_col5 rowe_col1: ld a,(sepw) bit 1,a set 1,a jr z,sepw_done res 1,a sepw_done: ld (sepw),a jp ep_loop_new rowe_col2: ld a,(dopw) bit 0,a set 0,a jr z,dopw_done res 0,a jr dopw_done rowe_col3: ld a,(anpw) bit 0,a set 0,a jr z,anpw_done res 0,a anpw_done: ld (anpw),a jp ep_loop_new rowe_col4: ld a,(tankpw) bit 1,a set 1,a jp z,tankpw_done res 1,a jp tankpw_done rowe_col5: ld a,(mdpw) bit 1,a set 1,a jp z,mdpw_done res 1,a jp mdpw_done check_pw: ld a,(anpw) or a jr z,pw_error cp 3 jr z,pw_error ld a,(mapw) or a jr z,pw_error cp 3 jr z,pw_error ld a,(mdpw) or a jr z,pw_error cp 3 jr z,pw_error ld a,(dopw) or a jr z,pw_error cp 3 jr z,pw_error ld a,(popw) or a jr z,pw_error cp 3 jr z,pw_error ld a,(frpw) or a jr z,pw_error cp 3 jr z,pw_error ld a,(sepw) or a jr z,pw_error cp 3 jr z,pw_error ld a,(sapw) or a jr z,pw_error cp 3 jr z,pw_error ld a,(mipw) or a jr z,pw_error cp 3 jr z,pw_error ld a,(tankpw) ld b,0 cp 1 jp z,pw_good inc b cp 2 jp z,pw_good inc b cp 4 jp z,pw_good inc b cp 8 jp z,pw_good inc b cp 16 jp z,pw_good pw_error: ROM_CALL(_clrlcdfull) call BUFCLR ld d,19 ld e,9 ld h,75 ld l,9 ld b,1 call FLine ld e,17 ld l,17 call FLine ld d,18 ld e,10 ld h,18 ld l,16 call FLine ld d,76 ld h,76 call FLine ld d,29 ld e,39 ld h,64 ld l,39 call FLine ld e,61 ld l,61 call FLine ld d,28 ld e,40 ld h,28 ld l,60 call FLine ld d,65 ld h,65 call FLine call BUFCOPY ld hl,10*256+20 ld (pencol),hl ld hl,pwerr ROM_CALL(_VPUTS) ld hl,40*256+30 ld (pencol),hl ld hl,pwtry ROM_CALL(_VPUTS) ld hl,47*256+33 ld (pencol),hl ld hl,yes ROM_CALL(_VPUTS) ld hl,54*256+31 ld (pencol),hl ld hl,no ROM_CALL(_VPUTS) pe_loop: ROM_CALL(_getk) cp k2nd jp z,enter_pw cp kAlpha ret z cp kMode ret z jr pe_loop pw_good: ld a,b ld (tanks),a ld a,(lvldone) ld b,a ld a,(anpw) bit 1,a jr z,pg1 set 0,b pg1: ld a,(mapw) bit 1,a jr z,pg2 set 1,b pg2: ld a,(mdpw) bit 1,a jr z,pg3 set 2,b pg3: ld a,(dopw) bit 1,a jr z,pg4 set 3,b pg4: ld a,(popw) bit 1,a jr z,pg5 set 4,b pg5: ld a,(frpw) bit 1,a jr z,pg6 set 5,b pg6: ld a,(sapw) bit 1,a jr z,pg7 set 6,b pg7: ld a,(mipw) bit 1,a jr z,pg_done set 7,b pg_done: ld a,b ld (lvldone),a ret ship_init: ld a,(bchk) or a ret z ld d,35 ld e,38 ld h,85 ld l,38 call FLine ld h,55 ld l,28 call FLine ld d,65 ld e,28 call FLine ld h,85 ld l,38 call FLine ld d,65 ld e,48 call FLine ld h,55 ld l,48 call FLine ld d,35 ld e,38 call FLine ld d,45 ld e,40 ld h,75 ld l,40 call FLine ld e,36 ld l,36 call FLine ld d,56 ld e,50 ld h,56 ld l,53 call FLine ld d,63 ld h,63 call FLine ld d,58 ld h,58 ld l,54 call FLine ld d,61 ld h,61 call FLine ld a,56 ld (xb),a ld a,16 ld (yb),a ret xor_laser: ld d,8 ld e,39 ld h,35 ld l,39 call FLine dec e dec h dec l call FLine dec e inc h dec l call FLine call check_spr call xor_char call xor_boss call BUFCOPY call xor_char call xor_boss ret wpn_fill: ld a,28 ld (enp),a ld (enan),a ld (enma),a ld (enmd),a ld (endo),a ld (ense),a ld (enpo),a ld (enfr),a ld (ensa),a ld (enmi),a ld (enwpn),a ret draw_nrg: ld a,(bchk) or a call nz,draw_bnrg ld d,10 ld e,38 ld h,10 ld a,(enp) ld b,a ld a,37 sub b ld l,a ld b,1 call FLine ld a,(wpn) or a ret z ld d,12 ; draw weapon energy line ld e,38 ld h,12 ld a,(enwpn) ld b,a ld a,37 sub b ld l,a ld b,1 call FLine ret draw_bnrg: ld d,86 ld e,38 ld h,86 ld a,(enb) ld b,a ld a,37 sub b ld l,a ld b,1 call FLine ret check_ehitu: ld a,(echk) cp 3 ret z ld a,(wx1) ld d,a ld a,(wy1) ld e,a ld a,(wchk1) ld c,a or a call nz,check_white ld a,c ld (wchk1),a ld a,(wx2) ld d,a ld a,(wy2) ld e,a ld a,(wchk2) ld c,a or a call nz,check_white ld a,c ld (wchk2),a ld a,(wx3) ld d,a ld a,(wy3) ld e,a ld a,(wchk3) ld c,a or a call nz,check_white ld a,c ld (wchk3),a ld a,(xmm) ld b,a ld a,(xe) sub 7 cp b ret nc add a,14 cp b ret c ld a,(ymm) ld b,a ld a,(ye) sub 11 cp b ret nc add a,18 cp b ret c ld a,(enp) or a sub 1 jr nc,ehitu_nokill xor a ehitu_nokill: ld (enp),a ld a,1 ld (hchk),a ret check_bhitu: ld a,(wx1) ld d,a ld a,(wy1) ld e,a ld a,(wchk1) ld c,a or a call nz,check_whitb ld a,c ld (wchk1),a ld a,(wx2) ld d,a ld a,(wy2) ld e,a ld a,(wchk2) ld c,a or a call nz,check_whitb ld a,c ld (wchk2),a ld a,(wx3) ld d,a ld a,(wy3) ld e,a ld a,(wchk3) ld c,a or a call nz,check_whitb ld a,c ld (wchk3),a ld a,(boss) cp 5 jr z,check_shitu ld a,(xmm) ld b,a ld a,(xb) sub 7 cp b ret nc add a,14 cp b ret c ld a,(ymm) ld b,a ld a,(yb) sub 11 cp b ret nc add a,22 cp b ret c ld a,(enp) or a sub 7 jr nc,bhitu_nokill xor a bhitu_nokill: ld (enp),a ld a,1 ld (hchk),a ret check_shitu: ld a,(xmm) ld b,a ld a,28 cp b ret nc xor a ld (enp),a ld a,1 ld (hchk),a ret check_bwhitu: ld a,(xmm) ld b,a ld a,(bwx) sub 7 cp b ret nc add a,14 cp b ret c ld a,(ymm) ld b,a ld a,38 cp b ret nc add a,14 cp b ret c ld a,(enp) or a sub 2 jr nc,bwhitu_nokill xor a bwhitu_nokill: ld (enp),a ld a,1 ld (hchk),a ret check_white: ld a,(xe) ld b,a ld a,d sub 7 cp b ret nc add a,14 cp b ret c ld a,(ye) ld b,a ld a,e sub 7 cp b ret nc add a,10 cp b ret c ld c,0 ld a,(ene) or a sub 1 jr nc,white_nokill xor a white_nokill: ld (ene),a or a ret nz ld a,3 ld (echk),a ret check_whitb: ld a,(boss) cp 5 jr z,check_whits ld a,(xb) ld b,a ld a,d sub 7 cp b ret nc add a,14 cp b ret c ld a,(yb) ld b,a ld a,e sub 11 cp b ret nc add a,14 cp b ret c ld c,0 call dam7_or1 ld a,(enb) or a sub 1 jr nc,whitb_nokill xor a whitb_nokill: ld (enb),a ret nz call won ret check_whits: ld b,35 ld a,d sub 7 cp b ret nc add a,14 cp b ret c ld b,42 ld a,e cp b ret nc add a,10 cp b ret c ld c,0 call dam7_or1 ld a,(enb) or a sub 1 jr nc,whits_nokill xor a whits_nokill: ld (enb),a or a ret nz call won ret dam7_or1: ld a,(wpn) or a ret z cp 5 ret z cp 1 jr z,an_on_po cp 2 jr z,ma_on_do cp 3 jr z,md_on_sa cp 4 jr z,do_on_fr cp 6 jr z,po_on_md cp 7 jr z,fr_on_an cp 8 jr z,sa_on_mi cp 9 jr z,mi_on_ma an_on_po: ld a,(boss) cp 5 jr z,damage7 cp 6 ret nz jr damage7 ma_on_do: ld a,(boss) or a jr z,damage7 cp 4 ret nz jr damage7 md_on_sa: ld a,(boss) cp 8 ret nz jr damage7 do_on_fr: ld a,(boss) cp 7 ret nz jr damage7 po_on_md: ld a,(boss) cp 3 ret nz jr damage7 fr_on_an: ld a,(boss) cp 1 ret nz jr damage7 sa_on_mi: ld a,(boss) cp 9 ret nz jr damage7 mi_on_ma: ld a,(boss) cp 2 ret nz damage7: ld a,(enb) or a sub 6 jr nc,dam7_nokill call won xor a dam7_nokill: ld (enb),a ret thrown_back: xor a ld (hchk),a ld hl,(xmm) call load_x or a ld de,8 sbc hl,de push hl push hl call CheckHorz pop hl call z,CheckHorz2 pop hl call z,CheckHorz3 jr nz,thrown_short ld a,(xmm) sub 8 ld (xmm),a ret thrown_short: ld hl,(xmm) call load_x push hl srl h rr l srl h rr l srl h rr l ; divide x by 8 add hl,hl add hl,hl add hl,hl ; multiply x by 8 push hl pop de pop hl or a sbc hl,de push hl ld hl,(xmm) pop de or a sbc hl,de ld (xmm),hl ret ;---------= Fast Copy =--------- ;Input: nothing ;Output: graph buffer is copied to the screen BUFCOPY: .equ GRB_COPY ; destroys BDE ; ; FASTLINE 83ASM 1.0 ; ; BRESENHAM'S LINE ALGORITHM ; by Jimmy M†rdell ; ported to 83asm by Joe Farley ; designed for use with mega man 83asm ; ; Parameters: B=pixel setting (1 for on, 0 for off) ; DE,HL = coordinates of line (D,E)-(H,L) ; 0 < D,H < 128, 0 < E,L < 64 ; ; writes to the graph buffer at 8E29h ; Code size: 145 bytes (excluding FindPixel) ; ; Registers: AF destroyed. ; ; Performance: 4 times faster than Stephane Jantzens line routine ; ; Delta_X > Delta_Y => innerloop = 98.50 T states ; Delta_Y > Delta_X => innerloop = 106.75 T states ; FLine: ;dave- the routine begins here push bc ld a,b ld (pixelsetting),a push de push hl ld a,h cp d jr nc,DXpos ex de,hl DXpos: ld b,d ld c,e ld de,PLOTSSCREEN push hl call FindPixel add hl,de ex (sp),hl ld e,c ld c,a ld a,h sub b ld b,a ld a,l sub e ld de,12 jr nc,DYpos neg ld de,-12 DYpos: push af sub b jr nc,DY_Greater add a,a neg ld (x_ai+1),a pop af add a,a ld (XDNeg+1),a sub b pop hl push af ld a,c call setpixel pop af bit 7,a jr nz,XDNeg XNewRow: add hl,de x_ai: sub 0 push af rrc c jr nc,XNoWrap1 inc hl XNoWrap1: ld a,c call setpixel pop af dec b jr z,LineDone jr nc,XNewRow XDNeg: add a,0 push af rrc c jr nc,XNoWrap2 inc hl XNoWrap2: ld a,c call setpixel pop af dec b jr z,LineDone jr c,XNewRow jr XDNeg DY_Greater: neg add a,a ld (YNoWrap+1),a ld a,b add a,a ld (YDNeg+1),a pop hl sub h ld b,h pop hl push af ld a,c call setpixel pop af YRepeat: bit 7,a jr nz,YDNeg rrc c jr nc,YNoWrap inc hl YNoWrap: add a,0 jr YPlot YDNeg: add a,0 YPlot: add hl,de push af ld a,c call setpixel pop af djnz YRepeat LineDone: pop hl pop de pop bc ret setpixel: push af ld a,(pixelsetting) cp 1 jr z,orpixel pop af cpl and (hl) ld (hl),a jr orpixelend orpixel: pop af or (hl) ld (hl),a orpixelend: ret ; ; This is your default FindPixel routine. Can be exchanged with ; the famous Eble-Yopp... FindPixel routine. ; FindPixel: push bc push de ld hl,ExpTable ld d,0 ld a,b and $07 ld e,a add hl,de ld e,(hl) ld h,d srl b srl b srl b ld a,c add a,a add a,a ld l,a add hl,hl push de ld e,a ld d,0 add hl,de pop de ld a,e ld e,b add hl,de pop de pop bc ret ExpTable: .db $80,$40,$20,$10,$08,$04,$02,$01 pixelsetting: .db 0 ;and it ends here ;ÜÛÛÛÛÛÛÛÛÛÛÛÛß SPRXOR ßÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ;³ Xor 8x8 sprite þ a=x, e=y, bc=sprite address ³ ;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ SPRXOR: push hl ; Save sprite address ;ÛÛÛÛ Calculate the address in graphbuf ÛÛÛÛ ld hl,0 ; Do y*12 ld d,0 add hl,de add hl,de add hl,de add hl,hl add hl,hl ld d,0 ; Do x/8 ld e,a srl e srl e srl e add hl,de ld de,PLOTSSCREEN add hl,de ; Add address to graphbuf ld b,00000111b ; Get the remainder of x/8 and b or a ; Is this sprite aligned to 8*n,y? jp z,XALIGN ;ÛÛÛÛ Non aligned sprite blit starts here ÛÛÛÛ pop ix ; ix->sprite ld d,a ; d=how many bits to shift each line ld e,c ; Line loop XLILOP: ld b,(ix+0) ; Get sprite data ld c,0 ; Shift loop push de XSHLOP: srl b rr c dec d jp nz,XSHLOP pop de ld a,b ; Write line to graphbuf xor (hl) ld (hl),a inc hl ld a,c xor (hl) ld (hl),a ld bc,11 ; Calculate next line address add hl,bc inc ix ; Inc spritepointer dec e jp nz,XLILOP ; Next line jp XDONE1 ;ÛÛÛÛ Aligned sprite blit starts here ÛÛÛÛ XALIGN: ; Blit an aligned sprite to graphbuf pop de ; de->sprite ld b,c XALOP1: ld a,(de) xor (hl) ld (hl),a inc de push bc ld bc,12 add hl,bc pop bc djnz XALOP1 XDONE1: ret ;ÜÛÛÛÛÛÛÛÛÛÛÛÛÜ SPRXOR ÜÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄ¿ ;³ÛÛÛÛÛ Z80 ÛÛÛÛÛÛ³ Sprite83 ³ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ³ movax ³ÛÛÛÛÛÛÛÛÛÛÛÛ³ ;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÙ _dispop1a: ROM_CALL(_FARCALL) \ .dw $6CA4 \ .db $04 _setxxop1: push af ROM_CALL(_OP1EXOP2) pop af push hl ld h,0 ld l,a ROM_CALL(_SETXXXXOP2) ROM_CALL(_OP1EXOP2) pop hl ret BUFCLR: push af \ push hl \ push de \ push bc LD HL,PLOTSSCREEN LD DE,PLOTSSCREEN+1 LD BC,$2FF LD A,0 LD (HL),A LDIR pop bc \ pop de \ pop hl \ pop af RET a_n: .db "Anchorman",0 m_a: .db "Mailman",0 m_d: .db "Madman",0 d_o: .db "Doorman",0 t_i: .db "Titanic Iniquity",0 p_o: .db "Policeman",0 f_r: .db "Freshman",0 s_a: .db "Salesman",0 m_i: .db "Milkman",0 p: .db "P",0 an: .db "AN",0 ma: .db "MA",0 md: .db "MD",0 do: .db "DO",0 se: .db "??",0 po: .db "PO",0 fr: .db "FR",0 sa: .db "SA",0 mi: .db "MI",0 a: .db "A",0 b: .db "B",0 c: .db "C",0 d: .db "D",0 e: .db "E",0 one: .db "1",0 two: .db "2",0 three: .db "3",0 four: .db "4",0 five: .db "5",0 enter: .db "Press Enter",0 yougot: .db "You Got",0 ygan: .db "Anchor Toss",0 ygma: .db "Stamp Throw",0 ygmd: .db "Swearing Scream",0 ygdo: .db "Splinter Shot",0 ygpo: .db "Badge Boomerang",0 ygfr: .db "Zit Shield",0 ygse: .db "and Top Secret Weapon",0 ygsa: .db "Bill Charge",0 ygmi: .db "Milk Bubble",0 pwerr: .db "Password Error!",0 pwtry: .db "Try Again?",0 yes: .db "2nd = Yes",0 no: .db "Alpha = No",0 gover: .db "Game Over",0 cont: .db "2nd = Continue",0 stgsel: .db "Alpha = Stage Select",0 endgame: .db "Mode = End",0 intro1: .db "The battles of Mega Man and",0 intro2: .db "Dr. Wily raged for many",0 intro3: .db "years, until age finally",0 intro4: .db "began to take its toll on",0 intro5: .db "Wily. In the final years of",0 intro6: .db "his life, Wily devoted all",0 intro7: .db "his time to constructing",0 intro8: .db "his most ingenious and",0 intro9: .db "horrifying robotic",0 intro10: .db "creation ever...",0 intro11: .db "Having used his cherished",0 intro12: .db "TI-82 calculator as the",0 intro13: .db "very core of his greatest",0 intro14: .db "masterpiece, Wily, with",0 intro15: .db "his last dying breath,",0 intro16: .db "dubbed his new successor:",0 intro17: .db "'Titanic Iniquity',",0 intro18: .db "or 'TI' for short. Mega Man",0 intro19: .db "must now stop TI and his 8",0 intro20: .db "new robot masters...",0 end1: .db "Upon the destruction of TI,",0 end2: .db "Mega Man is visibly upset",0 end3: .db "that such a great thing had",0 end4: .db "to be destroyed...",0 end5: .db "Had it not been for Dr. Wily,",0 end6: .db "the TI-82 calc might",0 end7: .db "have been used for good",0 end8: .db "instead of for evil...",0 end9: .db "These thoughts all ran",0 end10: .db "through the mind of our hero",0 end11: .db "as he turned around to head",0 end12: .db "back to the lab...",0 end13: .db "Mega Man was just about",0 end14: .db "to leave, when he realized",0 end15: .db "that some good could still",0 end16: .db "come out of TI...",0 end17: .db "As a robot, Mega Man can",0 end18: .db "program and re-program",0 end19: .db "just about anything, and",0 end20: .db "TI was no exception...",0 end21: .db "he quickly ran over to the",0 end22: .db "lifeless robot and used",0 end23: .db "all of his skill to make",0 end24: .db "his enemy into his friend...",0 end25: .db "In a short time, Mega Man",0 end26: .db "proved his mastery in",0 end27: .db "re-programming, and TI",0 end28: .db "was reborn...",0 end29: .db "As they both left, Mega",0 end30: .db "Man knew that he would",0 end31: .db "never again have to face",0 end32: .db "Titanic Iniquity...",0 end33: .db "Often, TI would",0 end34: .db "ask his new friend",0 end35: .db "what his initials",0 end36: .db "stood for...",0 end37: .db "In response,",0 end38: .db "Mega Man",0 end39: .db "would always just",0 end40: .db "smile, and say...",0 end41: .db "'Thats Irrelevant.'",0 end42: .db " H",0 end43: .db " END.",0 cred1: .db "Programming:",0 cred2: .db "Graphics:",0 cred3: .db "Testers:",0 cred4: .db "Special Thanks to:",0 cred5: .db "Dave Jaklitsch",0 cred6: .db "Eddie Gallagher",0 cred7: .db "Jimmy Mardell",0 cred8: .db "Bill Nagel",0 cred9: .db "Hideaki Omuro",0 cred10: .db "Jeff Mears",0 cred11: .db "Hannes Edfeldt",0 cred12: .db "Joe Wingbermuehle",0 cred13: .db "Mark May",0 cred14: .db "The TI-Files",0 cred15: .db "The #TI-Files Crew",0 cred16: .db "Texas Instruments",0 cred17: .db "ZiLog",0 cred18: .db "Capcom",0 test1: .db "Matt Skrabanek",0 test2: .db "Matt Waters",0 test3: .db "Alex Sedeno",0 test4: .db "Andrew Ungvarsky",0 test5: .db "Dan Englender",0 test6: .db "Chad Whitman",0 test7: .db "Ian Kaplan",0 test8: .db "Ahmed El-Helw",0 test9: .db "Anthony Chan",0 test10: .db "Eric Chan",0 test11: .db "Matt Tandy",0 test12: .db "Dan Koester",0 test13: .db "Danny Welsh",0 test14: .db "Joe Farley",0 test15: .db "Chris Musolf",0 test16: .db "Stuart Bergstrom",0 test17: .db "Matt Senator",0 test18: .db "Fred Coughlin",0 test19: .db "Steven Gerstacker",0 test20: .db "Luke Rosenburg",0 pres: .db "Presented by:",0 djs: .db "D. JacKaL Software",0 pre: .db "Presents...",0 logo: .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 .DB $00,$00,$00,$07,$8F,$DF,$DF,$F7,$F0,$00,$00,$00 .DB $00,$00,$00,$0F,$9F,$FF,$FF,$F7,$F8,$00,$00,$00 .DB $00,$00,$00,$1F,$BF,$FE,$3E,$07,$FC,$00,$00,$00 .DB $00,$00,$00,$20,$40,$43,$E2,$F4,$22,$00,$00,$00 .DB $00,$00,$00,$40,$08,$40,$62,$94,$01,$00,$00,$00 .DB $00,$00,$00,$84,$18,$C7,$E3,$8C,$00,$80,$00,$00 .DB $00,$00,$01,$0C,$30,$87,$E3,$CC,$00,$40,$00,$00 .DB $00,$00,$02,$1C,$F0,$80,$60,$0C,$3E,$20,$00,$00 .DB $00,$00,$04,$3B,$E0,$80,$60,$04,$3F,$10,$00,$00 .DB $00,$00,$08,$73,$E1,$80,$50,$04,$1F,$88,$00,$00 .DB $00,$00,$1F,$E3,$BF,$FF,$FF,$FF,$FF,$FC,$00,$00 .DB $00,$00,$20,$43,$80,$FC,$07,$E0,$FF,$C2,$00,$00 .DB $00,$00,$7F,$C3,$FF,$FF,$FF,$FF,$FF,$FF,$80,$00 .DB $00,$00,$80,$4C,$01,$08,$04,$20,$0C,$70,$40,$00 .DB $00,$01,$00,$58,$01,$10,$02,$20,$03,$38,$20,$00 .DB $00,$02,$00,$60,$01,$10,$C1,$20,$00,$DC,$10,$00 .DB $00,$04,$00,$40,$01,$20,$C1,$10,$00,$3E,$08,$00 .DB $00,$08,$08,$01,$01,$40,$00,$90,$00,$0F,$04,$00 .DB $00,$10,$18,$03,$02,$C1,$E0,$50,$20,$03,$82,$00 .DB $00,$3F,$FF,$FF,$FE,$FF,$FF,$DF,$FF,$FF,$FF,$00 .DB $00,$7F,$FF,$FF,$FF,$FF,$FF,$EF,$FF,$FF,$FF,$80 .DB $00,$FF,$F7,$FD,$FF,$FF,$FF,$EF,$FF,$FF,$FF,$C0 .DB $01,$01,$E4,$F2,$02,$07,$FC,$18,$07,$F0,$00,$20 .DB $02,$03,$C5,$E2,$06,$0F,$FC,$08,$09,$FC,$00,$10 .DB $04,$07,$87,$C2,$04,$0F,$FE,$08,$08,$7F,$00,$08 .DB $08,$0F,$07,$83,$FF,$FF,$FF,$FF,$F8,$1F,$FF,$F8 .DB $1F,$FE,$06,$07,$FF,$FC,$07,$FF,$FC,$0F,$FF,$F8 .DB $07,$FC,$00,$07,$FF,$F8,$03,$FF,$FC,$03,$FF,$F8 .DB $0F,$F8,$00,$07,$FF,$F0,$03,$FF,$FE,$00,$FF,$F8 .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 .DB $00,$00,$00,$0E,$18,$00,$81,$84,$40,$00,$00,$00 .DB $00,$00,$00,$11,$24,$00,$82,$46,$C0,$00,$00,$00 .DB $00,$00,$00,$11,$04,$00,$82,$05,$40,$00,$00,$00 .DB $00,$00,$00,$0E,$08,$01,$41,$05,$40,$00,$00,$00 .DB $00,$00,$00,$11,$10,$79,$40,$84,$40,$00,$00,$00 .DB $00,$00,$00,$11,$20,$01,$C0,$44,$40,$00,$00,$00 .DB $00,$00,$00,$11,$20,$02,$22,$44,$40,$00,$00,$00 .DB $00,$00,$00,$0E,$3C,$02,$21,$84,$40,$00,$00,$00 .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 .DB $00,$0F,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$80,$00 .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 .DB $00,$00,$00,$0E,$0F,$83,$03,$83,$E0,$00,$00,$00 .DB $00,$00,$00,$10,$02,$04,$82,$40,$80,$00,$00,$00 .DB $00,$00,$00,$10,$02,$04,$82,$40,$80,$00,$00,$00 .DB $00,$00,$00,$0C,$02,$07,$83,$80,$80,$00,$00,$00 .DB $00,$00,$00,$02,$02,$04,$82,$40,$80,$00,$00,$00 .DB $00,$00,$00,$02,$02,$04,$82,$40,$80,$00,$00,$00 .DB $00,$00,$00,$1C,$02,$04,$82,$40,$80,$00,$00,$00 .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 .DB $00,$00,$00,$1C,$63,$9D,$13,$39,$C0,$00,$00,$00 .DB $00,$00,$00,$12,$94,$21,$14,$A5,$20,$00,$00,$00 .DB $00,$00,$00,$12,$94,$21,$14,$A5,$20,$00,$00,$00 .DB $00,$00,$00,$1C,$F3,$19,$54,$B9,$20,$00,$00,$00 .DB $00,$00,$00,$10,$90,$85,$54,$A5,$20,$00,$00,$00 .DB $00,$00,$00,$10,$90,$85,$54,$A5,$20,$00,$00,$00 .DB $00,$00,$00,$10,$97,$38,$A3,$25,$C0,$00,$00,$00 .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 cbs: .DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF .DB $C0,$00,$00,$00,$80,$00,$00,$01,$00,$00,$00,$03 .DB $C0,$00,$00,$00,$80,$00,$00,$01,$00,$3F,$FC,$03 .DB $C0,$00,$00,$00,$80,$00,$00,$01,$00,$40,$02,$03 .DB $C0,$00,$00,$00,$80,$1F,$F8,$01,$00,$98,$19,$03 .DB $C0,$01,$80,$00,$80,$10,$48,$01,$01,$24,$24,$83 .DB $C0,$02,$40,$00,$80,$20,$44,$01,$01,$42,$5A,$83 .DB $C0,$02,$40,$00,$80,$28,$94,$01,$01,$42,$5A,$83 .DB $C0,$01,$80,$00,$80,$24,$A4,$01,$01,$5A,$42,$83 .DB $C0,$1F,$F8,$00,$80,$2C,$B4,$01,$01,$5A,$42,$83 .DB $C0,$21,$84,$00,$80,$4D,$32,$01,$01,$24,$24,$83 .DB $C0,$1E,$78,$00,$80,$41,$02,$01,$01,$19,$98,$83 .DB $C0,$02,$40,$00,$80,$41,$02,$01,$01,$01,$80,$83 .DB $C0,$42,$42,$00,$80,$42,$02,$01,$01,$41,$82,$83 .DB $C0,$42,$42,$00,$80,$82,$01,$01,$01,$20,$04,$83 .DB $C0,$42,$42,$00,$80,$82,$01,$01,$01,$1F,$F8,$83 .DB $C0,$A4,$25,$00,$80,$82,$01,$01,$01,$15,$00,$83 .DB $C0,$A4,$25,$00,$80,$82,$01,$01,$00,$91,$01,$03 .DB $C0,$A4,$25,$00,$81,$01,$00,$81,$00,$4E,$02,$03 .DB $C0,$A8,$15,$00,$81,$00,$80,$81,$00,$3F,$FC,$03 .DB $C0,$00,$00,$00,$80,$00,$00,$01,$00,$00,$00,$03 .DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF .DB $C0,$00,$00,$00,$80,$00,$00,$01,$00,$00,$00,$03 .DB $C0,$00,$00,$00,$80,$FF,$FF,$01,$00,$FF,$FF,$03 .DB $C0,$00,$00,$00,$80,$80,$01,$01,$00,$AA,$55,$03 .DB $C0,$3F,$FC,$00,$80,$86,$61,$01,$00,$AA,$55,$03 .DB $C0,$20,$04,$00,$80,$9C,$39,$01,$00,$FF,$FF,$03 .DB $C0,$2E,$E4,$00,$80,$E4,$27,$01,$00,$BF,$FD,$03 .DB $C0,$2A,$A4,$00,$80,$88,$11,$01,$00,$BE,$7D,$03 .DB $C0,$EA,$A7,$00,$BF,$FC,$3F,$FD,$00,$BE,$7D,$03 .DB $C1,$2E,$E4,$80,$A0,$16,$68,$05,$00,$9C,$39,$03 .DB $C1,$2A,$A4,$80,$A3,$F6,$6F,$C5,$00,$80,$81,$03 .DB $C1,$6A,$A6,$80,$AC,$10,$08,$35,$00,$80,$81,$03 .DB $C1,$6E,$E6,$80,$B0,$20,$04,$0D,$00,$81,$81,$03 .DB $C1,$60,$06,$80,$80,$3F,$FC,$01,$00,$80,$01,$03 .DB $C1,$60,$66,$80,$80,$08,$10,$01,$00,$80,$71,$03 .DB $C1,$60,$66,$80,$86,$10,$08,$61,$00,$5F,$8A,$03 .DB $C0,$A0,$05,$00,$85,$90,$09,$A1,$00,$40,$72,$03 .DB $C0,$2E,$E4,$00,$84,$60,$06,$21,$00,$20,$04,$03 .DB $C0,$2A,$A4,$00,$84,$00,$00,$21,$00,$3F,$FC,$03 .DB $C0,$2A,$A4,$00,$87,$FF,$FF,$E1,$00,$00,$00,$03 .DB $C0,$00,$00,$00,$80,$00,$00,$01,$00,$00,$00,$03 .DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF .DB $C0,$00,$00,$00,$80,$00,$00,$01,$00,$00,$00,$03 .DB $C0,$24,$24,$00,$80,$00,$00,$01,$00,$00,$30,$03 .DB $C0,$92,$49,$00,$80,$0C,$30,$01,$00,$00,$D0,$03 .DB $C1,$52,$4A,$80,$80,$0C,$30,$01,$00,$03,$08,$03 .DB $C0,$7E,$7E,$00,$80,$3F,$FE,$01,$00,$04,$64,$03 .DB $C0,$C3,$C3,$00,$80,$7F,$FE,$01,$00,$05,$84,$03 .DB $C1,$4B,$D2,$80,$80,$6C,$30,$01,$00,$0C,$04,$03 .DB $C1,$4A,$52,$80,$80,$6C,$30,$01,$00,$12,$02,$03 .DB $C1,$42,$42,$80,$80,$6C,$30,$01,$00,$22,$02,$03 .DB $C1,$7E,$7E,$80,$80,$6C,$30,$01,$00,$42,$01,$03 .DB $C1,$20,$04,$80,$80,$6C,$30,$01,$00,$C1,$03,$03 .DB $C1,$0A,$50,$80,$80,$7F,$FC,$01,$00,$B9,$0D,$03 .DB $C1,$41,$82,$80,$80,$3F,$FE,$01,$00,$86,$B1,$03 .DB $C1,$88,$11,$80,$80,$0C,$36,$01,$00,$A1,$C1,$03 .DB $C0,$A7,$E5,$00,$80,$0C,$36,$01,$00,$B2,$89,$03 .DB $C0,$C2,$43,$00,$80,$0C,$36,$01,$00,$96,$95,$03 .DB $C0,$63,$C6,$00,$80,$0C,$36,$01,$00,$84,$95,$03 .DB $C0,$30,$0C,$00,$80,$0C,$36,$01,$00,$A0,$95,$03 .DB $C0,$1F,$F8,$00,$80,$7F,$FC,$01,$00,$9E,$95,$03 .DB $C0,$00,$00,$00,$80,$00,$00,$01,$00,$00,$00,$03 .DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF uprlft: .db %11111111 .db %10000000 .db %10000000 .db %10000000 .db %10000000 .db %10000000 .db %10000000 .db %10000000 uprrt: .db %11111111 .db %00000001 .db %00000001 .db %00000001 .db %00000001 .db %00000001 .db %00000001 .db %00000001 lwrlft: .db %10000000 .db %10000000 .db %10000000 .db %10000000 .db %10000000 .db %10000000 .db %10000000 .db %11111111 lwrrt: .db %00000001 .db %00000001 .db %00000001 .db %00000001 .db %00000001 .db %00000001 .db %00000001 .db %11111111 bint: .db %00000000 .db %00000000 .db %11111111 .db %01010101 .db %10101010 .db %11111111 .db %00000000 .db %00000000 pwcurs: .db %10000001 .db %01011010 .db %00100100 .db %01000010 .db %01000010 .db %00100100 .db %01011010 .db %10000001 pwdot: .db %00000000 .db %00000000 .db %00011000 .db %00111100 .db %00111100 .db %00011000 .db %00000000 .db %00000000 lvlspr: ; 0=blank .db %00000000 .db %00000000 .db %00000000 .db %00000000 .db %00000000 .db %00000000 .db %00000000 .db %00000000 ; 1=ceiling .db %11111111 .db %10101011 .db %11010101 .db %10101011 .db %11010101 .db %10101011 .db %11010101 .db %11111111 ; 2=block .db %11111111 .db %10000001 .db %10111101 .db %10100101 .db %10100101 .db %10111101 .db %10000001 .db %11111111 ; 3=floor .db %11111111 .db %10100101 .db %11111111 .db %10100101 .db %10100101 .db %11111111 .db %10100101 .db %11111111 ; 4=door .db %11111111 .db %00000000 .db %11111111 .db %00000000 .db %11111111 .db %00000000 .db %11111111 .db %00000000 ; 5=extra life head: .db %00111100 .db %01000010 .db %11111111 .db %10100101 .db %10000001 .db %01011010 .db %00100100 .db %00011000 ; 6=energy tank tank: .db %01111110 .db %10000001 .db %10111101 .db %10100001 .db %10111001 .db %10100001 .db %10111101 .db %01111110 ; 7=T enemy tleft: .db %11111111 .db %10011101 .db %10101001 .db %11101111 .db %01000100 .db %10110100 .db %10000010 .db %11111110 tright: .db %11111111 .db %10111001 .db %10010101 .db %11110111 .db %00100010 .db %00101101 .db %01000001 .db %01111111 ; 9=I enemy iup: .db %11111111 .db %10011101 .db %10101001 .db %11100111 .db %00110100 .db %01100110 .db %01000010 .db %01111110 idown: .db %01111110 .db %01000010 .db %01100110 .db %00110100 .db %11100111 .db %10101001 .db %10011101 .db %11111111 wpp: .db %00000000 .db %00011000 .db %00011000 .db %00000000 wpan: .db %00111100 .db %00011000 .db %01011010 .db %00111100 wpma: .db %01111110 .db %01001110 .db %01000010 .db %01111110 wpmd: .db %10010110 .db %10111001 .db %00111010 .db %10010010 wpdo: .db %00000000 .db %01111111 .db %01111111 .db %00000000 wpse: .db %01100110 .db %10011001 .db %00100010 .db %00100010 wppo: .db %01011010 .db %01100110 .db %00100100 .db %00011000 wpfr: .db %10101010 .db %01010101 .db %10101010 .db %01010101 wpsa: .db %00111100 .db %11111111 .db %11111111 .db %00111100 wpmi: .db %00111100 .db %01011010 .db %01000010 .db %00111100 mmsr: .db %00011000 .db %00100100 .db %01011110 .db %01101010 .db %00100100 .db %00011000 .db %01100110 .db %11100111 .db %11011011 .db %00111100 .db %01011010 .db %11100111 mmrr: .db %00011000 .db %00100100 .db %01011110 .db %01101010 .db %00100100 .db %00011000 .db %11100110 .db %11100110 .db %00011000 .db %11111100 .db %11101010 .db %00001110 mmrr2: .db %00011000 .db %00100100 .db %01011110 .db %01101010 .db %00100100 .db %00011000 .db %01100100 .db %01110100 .db %00111000 .db %00111100 .db %01010100 .db %01101100 mmjr: .db %00011000 .db %00100100 .db %01011110 .db %01101010 .db %00100100 .db %11011011 .db %11100111 .db %01100110 .db %00111100 .db %00111010 .db %01011111 .db %01100000 mmwr: .db %00011000 .db %00100100 .db %01011110 .db %01101010 .db %00100100 .db %00011000 .db %01100111 .db %11100111 .db %11011000 .db %00111100 .db %01010100 .db %11101110 mmhr: .db %00110001 .db %01011000 .db %10111101 .db %11100100 .db %01001001 .db %00110000 .db %11001100 .db %11100010 .db %00010010 .db %01101100 .db %10010100 .db %11101100 mmsl: .db %00011000 .db %00100100 .db %01111010 .db %01010110 .db %00100100 .db %00011000 .db %01100110 .db %11100111 .db %11011011 .db %00111100 .db %01011010 .db %11100111 mmrl: .db %00011000 .db %00100100 .db %01111010 .db %01010110 .db %00100100 .db %00011000 .db %01100111 .db %01100111 .db %00011000 .db %00111111 .db %01010111 .db %01110000 mmrl2: .db %00011000 .db %00100100 .db %01111010 .db %01010110 .db %00100100 .db %00011000 .db %00100110 .db %00101110 .db %00011100 .db %00111100 .db %00101010 .db %00110110 mmjl: .db %00011000 .db %00100100 .db %01111010 .db %01010110 .db %00100100 .db %11011011 .db %11100111 .db %01100110 .db %00111100 .db %01011100 .db %11111010 .db %00000110 mmwl: .db %00011000 .db %00100100 .db %01111010 .db %01010110 .db %00100100 .db %00011000 .db %11100110 .db %11100111 .db %00011011 .db %00111100 .db %00101010 .db %01110111 mmhl: .db %10001100 .db %00011010 .db %10111101 .db %00100111 .db %10010010 .db %00001100 .db %00110011 .db %01000111 .db %01001000 .db %00110110 .db %00101001 .db %00110111 ansl: .db %00011000 .db %00100100 .db %00100100 .db %00011000 .db %01111110 .db %00011000 .db %10011001 .db %01011010 .db %00111100 .db %00111100 .db %01100110 .db %11100111 masl: .db %01111110 .db %01000110 .db %01001010 .db %01010010 .db %11010011 .db %11010011 .db %11001011 .db %01000110 .db %01111110 .db %00111100 .db %01100110 .db %11100111 mdsl: .db %00011110 .db %00011110 .db %00101110 .db %01010010 .db %00100100 .db %10011000 .db %11111110 .db %01111111 .db %00011001 .db %00111100 .db %01100110 .db %11100111 dosl: .db %01111110 .db %01000010 .db %01000010 .db %01000010 .db %11110011 .db %11110011 .db %11000011 .db %01000010 .db %01111110 .db %00111100 .db %01100110 .db %11100111 tisl: .db %11111111 .db %10100101 .db %11100111 .db %00100100 .db %00100100 .db %01000010 .db %01111110 .db %11000011 .db %11100111 .db %11011011 .db %01100110 .db %11100111 posl: .db %01111110 .db %01100110 .db %01010010 .db %01000010 .db %00100100 .db %00011000 .db %10111110 .db %11111111 .db %10011001 .db %10111100 .db %01100110 .db %11100111 frsl: .db %10100101 .db %11111111 .db %10100101 .db %11100111 .db %01011010 .db %01000010 .db %00111100 .db %11111111 .db %11011011 .db %00111100 .db %01100110 .db %11100111 sasl: .db %00011000 .db %00100100 .db %00100100 .db %00011000 .db %00111110 .db %11011000 .db %11111111 .db %00011011 .db %01111100 .db %00111100 .db %01100110 .db %11100111 misl: .db %00011100 .db %00100010 .db %01111111 .db %01000101 .db %11101101 .db %11000111 .db %11111111 .db %01000111 .db %01000101 .db %01111111 .db %01100110 .db %11100111 lvlan: .db 1,2,2,2,2,2,2,3 .db 1,0,0,0,0,0,0,3 .db 1,0,0,0,0,0,0,3 .db 1,0,0,0,0,0,3,3 .db 1,0,0,0,0,0,3,3 .db 1,0,0,0,0,0,3,3 .db 1,0,0,0,0,3,3,3 .db 1,0,0,0,0,3,3,3 .db 1,0,0,0,0,3,3,3 .db 1,0,0,0,3,3,3,3 .db 1,0,0,0,3,3,3,3 .db 1,0,0,0,3,3,3,3 .db 1,0,0,0,0,0,0,0 .db 1,0,0,0,0,0,0,0 .db 1,0,0,7,3,0,0,3 .db 1,0,0,0,3,0,0,3 .db 1,0,0,0,3,0,0,3 .db 1,0,0,0,3,0,0,3 .db 1,0,0,0,3,0,0,3 .db 1,0,0,0,3,0,0,3 .db 1,0,0,0,3,0,0,3 .db 1,0,0,0,3,0,0,3 .db 1,0,0,0,3,0,0,3 .db 1,0,0,0,3,0,0,3 .db 1,0,0,0,3,0,0,0 .db 1,0,0,0,3,0,0,0 .db 1,0,0,0,3,0,0,0 .db 1,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