Prev: 53380 Up: Map Next: 54122
53526: Check enemy-player collision
Used by the routine at CHECK_ENEMY_COLLISIONS.
Input
IX points at enemy from ENEMY_DATA
L53526 53526 LD D,(IX+0)
53529 LD E,(IX+1)
53532 LD A,D
53533 AND 3
53535 JP NZ,L53526_16
53538 CALL L54122
53541 PUSH HL
53542 POP IY
53544 LD A,(IX+3)
53547 AND A
53548 JP Z,L53526_12
53551 DEC A
53552 JP Z,L53526_0
53555 DEC A
53556 JP Z,L53526_1
53559 DEC A
53560 JP Z,L53526_4
53563 DEC A
53564 JP Z,L53526_8
53567 DEC A
53568 JP Z,L53526_13
53571 JP L53526_12
L53526_0 53574 LD A,(IX+1)
53577 CP 11
53579 JP C,L53526_17
53582 LD A,(IY-8)
53585 CP 127
53587 JP Z,L53526_17
53590 LD (IX+2),255
53594 SRL D
53596 SRL E
53598 PUSH IX
53600 CALL L56342
53603 POP IX
53605 RET
L53526_1 53606 LD A,(59674)
53609 RRA
53610 RRA
53611 RRA
53612 RRA
53613 AND 1
53615 INC A
53616 LD D,A
53617 LD A,(IY-8)
53620 CP 127
53622 RL D
53624 LD A,(IY+1)
53627 ADD A,(IY-7)
53630 CP 254
53632 JP Z,L53526_2
53635 RES 1,D
L53526_2 53637 LD A,(IY-1)
53640 ADD A,(IY-9)
53643 CP 254
53645 JP Z,L53526_3
53648 RES 2,D
L53526_3 53650 LD (IX+2),D
53653 JP L53526_18
L53526_4 53656 LD A,(IY+0)
53659 ADD A,(IY-8)
53662 CP 254
53664 JP NZ,L53526_7
53667 LD A,(59650) Load A with player Y coord
53670 CP (IX+0)
53673 JP NZ,L53526_5
53676 LD (IX+2),254
53680 RET
L53526_5 53681 LD A,0
53683 RLA
53684 LD (IX+2),A
53687 AND A
53688 JP NZ,L53526_6
53691 LD A,(IX+0)
53694 CP 25
53696 JP NC,L53526_21
53699 LD A,(IY+1)
53702 CP 127
53704 JP Z,L53526_21
53707 LD (IX+2),254
53711 RET
L53526_6 53712 LD A,(IX+0)
53715 CP 4
53717 JP C,L53526_21
53720 LD A,(IY-1)
53723 CP 127
53725 JP Z,L53526_21
53728 LD (IX+2),254
53732 RET
L53526_7 53733 LD D,(IX+0)
53736 LD E,(IX+1)
53739 SRL D
53741 SRL E
53743 PUSH IX
53745 CALL L56342
53748 POP IX
53750 LD (IX+2),255
53754 RET
L53526_8 53755 LD A,(IX+0)
53758 AND A
53759 JP Z,L53526_9
53762 CP 28
53764 JP Z,L53526_10
53767 LD A,(IY-1)
53770 CP 127
53772 JP NZ,L53526_9
53775 LD A,(IY+1)
53778 CP 127
53780 JP NZ,L53526_10
53783 JP L53526_23
L53526_9 53786 LD A,(IY+1)
53789 CP 127
53791 JP NZ,L53526_11
53794 LD (IX+2),0
53798 JP L53526_23
L53526_10 53801 LD A,(IY-1)
53804 CP 127
53806 JP NZ,L53526_11
53809 LD (IX+2),1
53813 JP L53526_23
L53526_11 53816 LD (IX+2),254
53820 JP L53526_23
L53526_12 53823 LD A,(IX+1)
53826 CP 11
53828 JP C,L53526_25
53831 LD A,(IY-8)
53834 CP 127
53836 JP Z,L53526_25
53839 LD (IX+2),255
53843 SRL D
53845 SRL E
53847 PUSH IX
53849 CALL L56342
53852 POP IX
53854 JP L53526_25
L53526_13 53857 LD A,(59674)
53860 RRA
53861 RRA
53862 RRA
53863 RRA
53864 AND 1
53866 INC A
53867 LD D,A
53868 LD A,(IY-8)
53871 CP 127
53873 RL D
53875 LD A,(IY+1)
53878 ADD A,(IY-7)
53881 CP 254
53883 JP Z,L53526_14
53886 RES 1,D
L53526_14 53888 LD A,(IY-1)
53891 ADD A,(IY-9)
53894 CP 254
53896 JP Z,L53526_15
53899 RES 2,D
L53526_15 53901 LD (IX+2),D
53904 JP L53526_26
L53526_16 53907 LD A,(IX+3)
53910 AND A
53911 JP Z,L53526_25
53914 DEC A
53915 JP Z,L53526_17
53918 DEC A
53919 JP Z,L53526_18
53922 DEC A
53923 JP Z,L53526_21
53926 DEC A
53927 JP Z,L53526_23
53930 DEC A
53931 JP Z,L53526_26
53934 JP L53526_25
L53526_17 53937 DEC (IX+1)
53940 LD A,(IX+1)
53943 CP 4
53945 RET NC
53946 LD (IX+2),255
53950 RET
L53526_18 53951 LD A,(IX+2)
53954 RRA
53955 RRA
53956 JP C,L53526_19
53959 RRA
53960 JP NC,L53526_20
53963 LD A,(IX+0)
53966 DEC A
53967 CP 255
53969 JP Z,L53526_20
53972 LD (IX+0),A
53975 JP L53526_20
L53526_19 53978 LD A,(IX+0)
53981 INC A
53982 CP 29
53984 JP Z,L53526_20
53987 LD (IX+0),A
L53526_20 53990 LD A,(IX+2)
53993 RRA
53994 JP NC,L53526_17
53997 RET
L53526_21 53998 LD A,(IX+2)
54001 CP 254
54003 RET Z
54004 RRA
54005 JP NC,L53526_22
54008 LD A,(IX+0)
54011 DEC A
54012 CP 255
54014 RET Z
54015 LD (IX+0),A
54018 JP L53526_17
L53526_22 54021 LD A,(IX+0)
54024 INC A
54025 CP 29
54027 RET Z
54028 LD (IX+0),A
54031 JP L53526_17
L53526_23 54034 LD A,(IX+2)
54037 CP 254
54039 RET Z
54040 AND A
54041 JP Z,L53526_24
54044 DEC (IX+0)
54047 DEC (IX+0)
54050 RET
L53526_24 54051 INC (IX+0)
54054 INC (IX+0)
54057 RET
L53526_25 54058 DEC (IX+1)
54061 DEC (IX+1)
54064 LD A,(IX+1)
54067 CP 4
54069 RET NC
54070 LD (IX+2),255
54074 RET
L53526_26 54075 LD A,(IX+2)
54078 RRA
54079 RRA
54080 JP C,L53526_27
54083 RRA
54084 JP NC,L53526_28
54087 LD A,(IX+0)
54090 DEC A
54091 CP 255
54093 JP Z,L53526_28
54096 LD (IX+0),A
54099 JP L53526_20
L53526_27 54102 LD A,(IX+0)
54105 INC A
54106 CP 29
54108 JP Z,L53526_28
54111 LD (IX+0),A
L53526_28 54114 LD A,(IX+2)
54117 RRA
54118 JP NC,L53526_25
54121 RET
Prev: 53380 Up: Map Next: 54122