Prev: 54539 Up: Map Next: 54666
54569: Check entity at IX for collision with another (impassable / pushable) entity immediately to the right
Used by the routines at 36116, 52148, 52193, 52889, 52914, 54313 and 55041.
Input
IX Address of complex state data for an entity
Output
F Carry flag set if no entity found, reset otherwise
A Class of entity, if found, otherwise 255
IY Address of complex state data for colliding entity
54569 LD DE,13 Load DE with 13 (as entries in complex state data are 13 bytes wide)
54572 LD IY,(34238) Load start address of current level's complex state data into IY
54576 LD A,(IY+0) Load A with room index for current IY entity
54579 CP 255 If this is not 255 (i.e. end marker)...
54581 JR NZ,54585 ...then skip ahead to 54585
54583 SCF Set carry flag
54584 RET Return
54585 LD A,(IX+0) If room of entity at IX is not the same as room of entity at IY...
54588 CP (IY+0) ...
54591 JR NZ,54662 ...then advance IY to next entity
54593 BIT 5,(IY+10) If current entity at IY has its is-being-carried flag set...
54597 JP NZ,54662 ...then advance IY to next entity
54600 LD A,(IY+8) If current entity at IY has a class which is the same as the entity at IX...
54603 CP (IX+8) ...
54606 JR Z,54662 ...then advance IY to next entity
54608 BIT 7,A If entity at IY has its spans-full-depth flag set...
54610 JR NZ,54620 ...then skip over depth check to 54620
54612 LD A,(IY+1) If entity at IY has a depth which is not the same as the depth of the entity at IX...
54615 CP (IX+1) ...
54618 JR NZ,54662 ...then advance IY to next entity
54620 LD A,(IY+11) If entity at IY has its impassable/pushable-rightwards flag reset...
54623 AND 32 ...
54625 JP Z,54662 ...then advance IY to next entity
54628 LD A,(IX+7) If the right side of entity at IX...
54631 INC A ...
54632 CP (IY+5) ...is not immediately to the left of the left side of the entity at IY...
54635 JR NZ,54662 ...then advance IY to next entity
54637 LD A,(IX+6) If the bottom of the entity at IX...
54640 CP (IY+4) ...is above the top of the entity at IY...
54643 JR C,54662 ...then advance IY to next entity
54645 LD A,(IY+6) If the bottom of the entity at IY...
54648 CP (IX+4) ...is above the top of the entity at IX...
54651 JR C,54662 ...then advance IY to next entity
54653 XOR A Set A to zero to reset carry flag
54654 LD (34258),IY Store pointer to current entity at 34258
54658 LD A,(IY+8) Load A with class of entity at IY
54661 RET Return
54662 ADD IY,DE Advance IY pointer to next entity in complex state data block
54664 JR 54576 Loop back to 54576
Prev: 54539 Up: Map Next: 54666