-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathDEBUG
783 lines (682 loc) · 13.1 KB
/
DEBUG
1
CHSET EQU &E000CHARHB EQU (&E0)/8CBASE EQU CHSET+(220*8);DRAWBULLETS ; JUST CALL IT AFTER COL;FIREBULLET ;X Y A;DRAWOBJECTS ; JUST CALL IT BEFORE COL;SETUPOBJECTS GETCHARDISPCHAR LDY FISTY LDA MULT40L,Y STA BUILD LDA MULT40H,Y CLC ADC #&F4 STA BUILD+1 LDY FISTX DISMC LDA (BUILD),Y RTSBEFORECOLOUR JSR DRAWOBJECTS JSR DRAWWATERMMYOU LDX #0 JSR MOVE LDX #1 JSR MOVE LDX #2 JMP MOVEAFTERCOLOUR JSR DRAWBULLETS JSR SETUPOBJECTS LDA #20 STA MIKE1BEER JSR OPENWINDOWS BCC BOUNC DEC MIKE1 BPL BEERBOUNC JSR HELISFIRE JMP MMYOUHELISFIRE LDA HEACT0 CMP #2 BEQ HELIS1 CMP #5 BEQ HELIS1 RTS HELIS1 DEC HELFIRE LDA HELFIRE AND #1 BEQ HELIS2HELI3 RTSHELIS2 JSR CHK0 BCS HELI3 LDX XTEMP LDY YTEMP LDA HEACT0 CMP #2 BEQ LFV ;DEX ;DEX LDA #3 JMP DSWLFV LDA #5 ;INX ;INXDSW STA DIRECTION INY INY LDA #1 JSR FIREBULLET LDA #1 LDX #1 JSR SOUND RTSNOBULLETJ JMP NOBULLETHELFIRE DB 0DRAWBULLETS LDX #2DSET1 LDA #0 STA PHIT,X LDA X,X LSR A LSR A SBC #1 STA MXMIN,X CLC ADC #2 STA MXMAX,X LDA Y,X LSR A LSR A LSR A SBC #1 STA MYMAX,X SEC SBC #3 STA MYMIN,X DEX BPL DSET1 LDA MXMIN STA FISTX LDA MYMIN STA FISTY ;JSR DISPCHAR LDA MXMAX STA FISTX LDA MYMAX STA FISTY ;JSR DISPCHAR LDY #31DRAW1 LDA BULL2,Y ; TYPE BEQ NOBULLETJ LDA SCREENTEMP EOR #&C CLC ADC BULL0,Y STA DBSMC+2 STA DB3SMC+2 LDA BULL1,Y ; MLOW STA DBSMC+1 STA DB3SMC+1 LDA BULL3,Y BEQ DBSMCDBSMC LDA &FFFF STA DB1SMC+1 LDA #CHARHB ASL DB1SMC+1 ROL A ASL DB1SMC+1 ROL A ASL DB1SMC+1 ROL A STA DB1SMC+2 LDA BULL8L,Y STA DB2SMC+1 LDA BULL8H,Y STA DB2SMC+2 LDX #7DB1SMC LDA &C000,X AND BULLETMASK,X ORA BULLET,XDB2SMC STA &C000,X DEX BPL DB1SMC TYA CLC ADC #220DB3SMC STA &FFFFCPLAYER1 LDA BULL4,Y CMP MXMIN BCC CPLAYER2 CMP MXMAX BCS CPLAYER2 LDA BULL5,Y CMP MYMIN ;MYMIN BCC CPLAYER2 CMP MYMAX ;MYMAX BCS CPLAYER2 LDA #1 STA PHIT CANCELJ JMP CANCELBULLETCPLAYER2 LDA BULL4,Y CMP MXMIN+1 BCC CPLAYER3 CMP MXMAX+1 BCS CPLAYER3 LDA BULL5,Y CMP MYMIN+1 BCC CPLAYER3 CMP MYMAX+1 BCS CPLAYER3 LDA #1 STA PHIT+1 JMP CANCELBULLETCPLAYER3 LDA BULL4,Y CMP MXMIN+2 BCC CPLAYER4 CMP MXMAX+2 BCS CPLAYER4 LDA BULL5,Y CMP MYMIN+2 BCC CPLAYER4 CMP MYMAX+2 BCS CPLAYER4 LDA #1 STA PHIT+1 JMP CANCELBULLETCPLAYER4 LDA BULL3,Y ; DIRECTION TAX LDA BULL4,Y CLC ADC BULXDIR,X STA BULL4,Y CMP #40 BCS CANCELJ LDA BULL5,Y CLC ADC BULYDIR,X STA BULL5,Y CMP #24 BCS CANCELJ CMP #3 BCC CANCELJ LDA BULL1,Y CLC ADC BUDIRECTL,X STA BULL1,Y LDA BULL0,Y ADC BUDIRECTH,X STA BULL0,YNOBULLET DEY BMI ALDONEDRAW1J JMP DRAW1ALDONE LDX #2NOACTION1 LDA PHIT,X BEQ NOACTION TXA PHA ;JSR LOSENERGY LDA #2 JSR SOUND PLA TAXNOACTION DEX BPL NOACTION1 RTSCANCELBULLET LDA #0 STA BULL2,Y DEY BPL DRAW1J BMI ALDONEMANSAVE DB 0FIRERATE DB 0MANFIRE DEC FIRERATE LDA FIRERATE AND #7 BNE MANFIRE1 STY MANSAVE LDA OBJ3,Y CLC ADC #1 AND #7 STA OBJ3,Y STA DIRECTION LDA OBJ4,Y ;X TAX LDA OBJ5,Y TAY LDA #1 JSR FIREBULLET LDY MANSAVEMANFIRE1 RTSFIRETEST LDA DIRECTION AND #3 STA DIRECTION LDX #10 LDY #10 LDA #1FIREBULLET ;X Y A=TYPE STX BULLETX STY BULLETY STA BULLETYPE LDA DIRECTION AND #7 STA DIRECTION LDY #31FIRE1 LDA BULL2,Y BEQ GOTSPARE DEY BPL FIRE1 RTSGOTSPARE LDA BULLETX STA BULL4,Y LDA BULLETY STA BULL5,Y TAX LDA MULT40L,X CLC ADC BULLETX STA BULL1,Y LDA MULT40H,X ADC #0 STA BULL0,Y LDA BULLETYPE STA BULL2,Y LDA DIRECTION STA BULL3,Y RTS;MANINWINDOW INC WINDOWCOUNT BEQ PUTMAN RTSPUTMAN LDA #8 STA DIRECTION INC WINDOW1 LDA WINDOW1 AND #7 STA WINDOW1 TAY LDX MANWX,Y LDA MANWY,Y TAY LDA WINDOW1 CLC ADC #15 JMP SETUPOBJECT ;************************ ;*DRAWOBJECTS LDY #31DRAW2 LDA OBJ2,Y ; TYPE BEQ DNOBJ LDA SCREENTEMP CLC ADC OBJ0,Y STA DO3SMC+2 STA DO4SMC+2 LDA OBJ1,Y ; MLOW STA DO3SMC+1 STA DO4SMC+1 LDA OBJ2,Y CMP #&A8 BCS DO4SMC LDA #&A0 ADC OBJ3,Y DO4SMC LDX &FFFF CPX #&19 BEQ DO3SMC CPX #&E3 BEQ DO3SMC CPX #&53 BCC CANCELOBJ CPX #76 BCS CANCELOBJ BNE CANCELOBJ ;;; WRONGDO3SMC STA &FFFF LDA OBJ2,Y CMP #&A7 BCS DNOBJ JSR MANFIREDNOBJ DEY BMI ALDONEO1DRAW2J JMP DRAW2ALDONEO1 RTSCANCELOBJ LDA #0 STA OBJ2,Y DEY BPL DRAW2J RTSSETUPOBJECTS INC MANWX BNE SETM1 INC MANWY BNE SETM1 LDA SYNC STA MANWX STA MANWYSETM1 LDA SYNC AND #15 TAY LDA BULLETCHARS,Y CMP #&FF BNE PUTOBJON RTSPUTOBJON PHA LDA MANWY AND #15 CLC ADC #7 TAY LDA MANWX AND #31 CLC ADC #7 TAX PLASETUPOBJECT ;X Y A=TYPE STX BULLETX STY BULLETY STA BULLETYPE LDY #31SW2 LDA OBJ2,Y BEQ GOTSPARE1 DEY BPL SW2 RTSGOTSPARE1 LDA BULLETX STA OBJ4,Y LDA BULLETY STA OBJ5,Y TAX LDA MULT40L,X CLC ADC BULLETX STA OBJ1,Y LDA MULT40H,X ADC #0 STA OBJ0,Y LDA BULLETYPE STA OBJ2,Y LDA #0 STA OBJ3,Y RTSMXMAX DS 3MYMAX DS 3MXMIN DS 3MYMIN DS 3WINDOW1 DB 0WINDOWCOUNT DB 0OBJECTPOINT DB 0BULLETX DB 0BULLETY DB 0BULLETYPE DB 0DIRECTION DB 0MANWY DB 5,20,15,17,4,5,6,8,10MANWX DB 10,20,12,4,5,6,16,2,20,26BUDIRECTL DB >-40,>-39,>1,>41,>40,>39,>-1,>-41,0BUDIRECTH DB <-40,<-39,<1,<41,<40,<39,<-1,<-41,0BULXDIR DB 0,1,1,1,0,-1,-1,-1,0BULYDIR DB -1,-1,0,1,1,1,0,-1,0BULLETMEM ; MEM ; DIR,TYPE,X,Y,TPOS BULLETWIPEBULL0 DS 32 ; MEM HIGHBULL1 DS 32 ; MEM LOWBULL2 DS 32 ; TYPEBULL3 DS 32 ; DIRECTIONBULL4 DS 32 ; XPOSBULL5 DS 32 ; YPOSBULL6 DS 32 ; TPOSBULL7 DS 32 ; CHAROBJECTWIPEOBJ0 DS 32 ; MEM HIGHOBJ1 DS 32 ; MEM LOWOBJ2 DS 32 ; TYPEOBJ3 DS 32 ; DIRECTIONOBJ4 DS 32 ; XPOSOBJ5 DS 32 ; YPOSOBJ6 DS 32 ; TPOSOBJ7 DS 32 ; CHARBUILDTYPE DS 8,&FFBUILDWIDE DS 8,&FF BUILDWIDE1 DS 8,&FFBUILDTALL DS 8,&FFBUILDDUST DS 8,&FF BULL8H DB <((0*8)+CBASE) DB <((1*8)+CBASE) DB <((2*8)+CBASE) DB <((3*8)+CBASE) DB <((4*8)+CBASE) DB <((5*8)+CBASE) DB <((6*8)+CBASE) DB <((7*8)+CBASE) DB <((8*8)+CBASE) DB <((9*8)+CBASE) DB <((10*8)+CBASE) DB <((11*8)+CBASE) DB <((12*8)+CBASE) DB <((13*8)+CBASE) DB <((14*8)+CBASE) DB <((15*8)+CBASE) DB <((16*8)+CBASE) DB <((17*8)+CBASE) DB <((18*8)+CBASE) DB <((19*8)+CBASE) DB <((20*8)+CBASE) DB <((21*8)+CBASE) DB <((22*8)+CBASE) DB <((23*8)+CBASE) DB <((24*8)+CBASE) DB <((25*8)+CBASE) DB <((26*8)+CBASE) DB <((27*8)+CBASE) DB <((28*8)+CBASE) DB <((29*8)+CBASE) DB <((30*8)+CBASE) DB <((31*8)+CBASE)BULL8L DB >((0*8)+CBASE) DB >((1*8)+CBASE) DB >((2*8)+CBASE) DB >((3*8)+CBASE) DB >((4*8)+CBASE) DB >((5*8)+CBASE) DB >((6*8)+CBASE) DB >((7*8)+CBASE) DB >((8*8)+CBASE) DB >((9*8)+CBASE) DB >((10*8)+CBASE) DB >((11*8)+CBASE) DB >((12*8)+CBASE) DB >((13*8)+CBASE) DB >((14*8)+CBASE) DB >((15*8)+CBASE) DB >((16*8)+CBASE) DB >((17*8)+CBASE) DB >((18*8)+CBASE) DB >((19*8)+CBASE) DB >((20*8)+CBASE) DB >((21*8)+CBASE) DB >((22*8)+CBASE) DB >((23*8)+CBASE) DB >((24*8)+CBASE) DB >((25*8)+CBASE) DB >((26*8)+CBASE) DB >((27*8)+CBASE) DB >((28*8)+CBASE) DB >((29*8)+CBASE) DB >((30*8)+CBASE) DB >((31*8)+CBASE)BULLETMASK DB %11111111 DB %11111111 DB %11001111 DB %00000011 DB %00000011 DB %11001111 DB %11111111 DB %11111111BULLET DB %00000000 DB %00000000 DB %00010000 DB %01100100 DB %01100100 DB %00010000 DB %00000000 DB %00000000OBJECTSTARTBULLETCHARS DB &FE ; BULLET 0 DB &FE ; GRENADE 1 DB &CD ; BONUS 0TURKEY DB &CE ; BONUS 1BULBOFF DB &C2 ; BONUS 2MILK DB &C3 ; BONUS 3SAFE DB &C4 ; BONUS 4MONEY DB &C5 ; BONUS 5TV DB &C5 ; POT DB &CF ; DANGER 0BULB ON DB &D0 ; DANGER 1CACTUS DB &A0 ; DANGER 2 DB &A1 ; DANGER 3 DB &A2 ; DANGER 4 DB &A3 ; DANGER 5 DB &A4 ; MAN 0 DB &A1 ; MAN 1 DB &A2 ; MAN 2 DB &A3 ; MAN 3 DB &A4 ; MAN 4 DB &A5 ; MAN 5 DB &A6 ; MAN 6 DB &A7 ; MAN 7 DB &FF ; END OF LIST OBJECTEND DB &FF DB &FFMULT40L DB >0*40 DB >1*40 DB >2*40 DB >3*40 DB >4*40 DB >5*40 DB >6*40 DB >7*40 DB >8*40 DB >9*40 DB >10*40 DB >11*40 DB >12*40 DB >13*40 DB >14*40 DB >15*40 DB >16*40 DB >17*40 DB >18*40 DB >19*40 DB >20*40 DB >21*40 DB >22*40 DB >23*40 DB >24*40 DB >25*40MULT40H DB <0*40 DB <1*40 DB <2*40 DB <3*40 DB <4*40 DB <5*40 DB <6*40 DB <7*40 DB <8*40 DB <9*40 DB <10*40 DB <11*40 DB <12*40 DB <13*40 DB <14*40 DB <15*40 DB <16*40 DB <17*40 DB <18*40 DB <19*40 DB <20*40 DB <21*40 DB <22*40 DB <23*40 DB <24*40 DB <25*40BXPOINT DW BXS0,BXS1,BXS2,BXS3,BXS4 DW BXS5,BXS6,BXS7,BXS8,BXS9 DW BXS10,BXS11,BXS12,BXS13 DW BXS14,BXS15,BXS16,BXS17 DW BXS18,BXS19,BXS0,BXS0TYPOINT DW BTYPE0,BTYPE1,BTYPE2,BTYPE3 DW BTYPE4,BTYPE5,BTYPE6,BTYPE7 DW BTYPE8,BTYPE9,BTYPE10,BTYPE11 DW BTYPE12,BTYPE13,BTYPE14,BTYPE15 DW BTYPE16,BTYPE17,BTYPE18,BTYPE19,BTYPE20,BTYPE20 ; BUILDING X'SBXS0 DB 10,4,26BXS1 DB 4,12,24,6,18,30BXS2 DB 4,16,30,6,20BXS3 DB 2,16,10,28BXS4 DB 26,4,20BXS5 DB 10,22,4,16,28BXS6 DB 8,22,4,26BXS7 DB 6,18,12,30BXS8 DB 26,16,4,22,10BXS9 DB 14,26,6,30BXS10 DB 26,4,10BXS11 DB 30,18,6,24,12,0BXS12 DB 20,6,30,16,4BXS13 DB 28,10,16,2BXS14 DB 20,4,26BXS15 DB 28,16,4,22,10BXS16 DB 26,4,22,8BXS17 DB 30,12,18,6BXS18 DB 10,22,4,16,28BXS19 DB 30,6,26,14BXS20 DB 20,&FF ; BUILDING TYPESBTYPE0 DB 0,1,2,&FFBTYPE1 DB 4,5,0,0,2,&FFBTYPE2 DB 2,1,0,5,3,&FFBTYPE3 DB 4,5,0,0,&FFBTYPE4 DB 4,2,0,&FFBTYPE5 DB 5,3,0,2,1,&FFBTYPE6 DB 4,5,1,1,&FFBTYPE7 DB 0,0,5,3,&FFBTYPE8 DB 3,5,3,1,2,&FFBTYPE9 DB 5,4,1,0,&FFBTYPE10 DB 3,2,5,&FFBTYPE11 DB 2,0,0,5,3,4,&FFBTYPE12 DB 3,5,0,1,2,&FFBTYPE13 DB 0,0,5,4,&FFBTYPE14 DB 0,2,4,&FFBTYPE15 DB 1,2,0,3,5,&FFBTYPE16 DB 1,1,5,4,&FFBTYPE17 DB 0,0,5,3,&FFBTYPE18 DB 2,1,3,5,3,&FFBTYPE19 DB 0,1,4,5,&FFBTYPE20 DB 0,&FFDAVE1 DB 0DAVE2 DB 0DAVE3 DB 0PHIT DS 3