Prev: 54569 Up: Map Next: 54764
54666: Check entity at IX for collision with another (impassable / pushable) entity immediately to the left
Used by the routines at 36116, 52053, 52098, 52870, 52914, 54348 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
54666 LD DE,13 Load DE with 13 (as entries in complex state data are 13 bytes wide)
54669 LD IY,(34238) Load start address of current level's complex state data into IY
54673 LD A,(IY+0) Load A with room index for current IY entity
54676 CP 255 If this is not 255 (i.e. end marker)...
54678 JR NZ,54682 ...then skip ahead to 54682
54680 SCF Set carry flag
54681 RET Return
54682 LD A,(IX+0) If room of entity at IX is not the same as room of entity at IY...
54685 CP (IY+0) ...
54688 JR NZ,54760 ...then advance IY to next entity
54690 BIT 5,(IY+10) If current entity at IY has its is-being-carried flag set...
54694 JP NZ,54760 ...then advance IY to next entity
54697 LD A,(IY+8) If current entity at IY has a class which is the same as the entity at IX...
54700 CP (IX+8) ...
54703 JP Z,54760 ...then advance IY to next entity
54706 BIT 7,A If entity at IY has its spans-full-depth flag set...
54708 JR NZ,54718 ...then skip over depth check to 54620
54710 LD A,(IY+1) If entity at IY has a depth which is not the same as the depth of the entity at IX...
54713 CP (IX+1) ...
54716 JR NZ,54760 ...then advance IY to next entity
54718 LD A,(IY+11) If entity at IY has its impassable/pushable-leftwards flag reset...
54721 AND 16 ...
54723 JP Z,54760 ...then advance IY to next entity
54726 LD A,(IX+5) If the left side of entity at IX...
54729 DEC A ...
54730 CP (IY+7) ...is not immediately to the right of the right side of the entity at IY...
54733 JR NZ,54760 ...then advance IY to next entity
54735 LD A,(IX+6) If the bottom of the entity at IX...
54738 CP (IY+4) ...is above the top of the entity at IY...
54741 JR C,54760 ...then advance IY to next entity
54743 LD A,(IY+6) If the bottom of the entity at IY...
54746 CP (IX+4) ...is above the top of the entity at IX...
54749 JR C,54760 ...then advance IY to next entity
54751 XOR A Set A to zero to reset carry flag
54752 LD (34258),IY Store pointer to current entity at 34258
54756 LD A,(IY+8) Load A with class of entity at IY
54759 RET Return
54760 ADD IY,DE Advance IY pointer to next entity in complex state data block
54762 JR 54673 Loop back to 54673
Prev: 54569 Up: Map Next: 54764