Prev: 54764 Up: Map Next: 54878
54768: Check entity at IX for collision with another entity at same depth whose interaction-(11,6) flag is set
Used by the routines at 36036, 36542, 37085, 38074, 38219, 38540, 38592, 41498, 41633, 41961, 42064, 42266, 42486, 48487, 51779, 53083, 55196 and 55525.
Input
IX Address of complex state data for an entity
C (Entry at 54770 only) Depth offset
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
54768 LD C,0 Set depth offset to 0 (i.e. check entities at same depth)
This entry point is used by the routine at 54764.
54770 LD IY,(34238) Load start address of current level's complex state data into IY
54774 LD DE,13 Load DE with 13 (as entries in complex state data are 13 bytes wide)
54777 LD A,(IY+0) Load A with room index for current IY entity
54780 CP 255 If this is not 255 (i.e. end marker)...
54782 JR NZ,54786 ...then skip ahead to 54786
54784 SCF Set carry flag
54785 RET Return
54786 LD A,(IX+0) If room of entity at IX is not the same as room of entity at IY...
54789 CP (IY+0) ...
54792 JR NZ,54874 ...then advance IY to next entity
54794 BIT 5,(IY+10) If current entity at IY has its is-being-carried flag set...
54798 JP NZ,54874 ...then advance IY to next entity
54801 LD A,(IY+8) If current entity at IY has a class which is the same as the entity at IX...
54804 CP (IX+8) ...
54807 JR Z,54874 ...then advance IY to next entity
54809 BIT 7,A If entity at IY has its spans-full-depth flag set...
54811 JR NZ,54822 ...then skip over depth check to 54822
54813 LD A,(IY+1) If entity at IY has a depth which is not the same as the depth of the entity at IX...
54816 ADD A,C ...plus depth offset...
54817 CP (IX+1) ...
54820 JR NZ,54874 ...then advance IY to next entity
54822 LD A,(IY+11) If entity at IY has its interaction-(11,6) flag reset...
54825 AND 64 ...
54827 JP Z,54874 ...then advance IY to next entity
54830 LD A,(IX+6) If the bottom of the entity at IX...
54833 CP (IY+4) ...is above the top of the entity at IY...
54836 JR C,54874 ...then advance IY to next entity
54838 LD A,(IY+6) If the bottom of the entity at IY...
54841 CP (IX+4) ...is above the top of the entity at IX...
54844 JR C,54874 ...then advance IY to next entity
54846 LD A,(IX+7) If the right side of entity IX...
54849 CP (IY+5) ...is to the left of the left side of the entity at IY...
54852 JR C,54874 ...then advance IY to next entity
54854 LD A,(IY+7) If the right side of entity IY...
54857 CP (IX+5) ...is to the left of the left side of the entity at IX...
54860 JR C,54874 ...then advance IY to next entity
54862 XOR A Set A to zero to reset carry flag
54863 LD (34258),IY Store pointer to current entity at 34258
54867 LD A,(IY+8) Load A with class of entity at IY
54870 RET Return
This entry point is used by the routines at 55196 and 55525.
54871 LD DE,13 Load DE with 13, as entries in complex state data are 13 bytes wide
54874 ADD IY,DE Advance IY pointer to next entity in complex state data block
54876 JR 54777 Loop back to 54777
Prev: 54764 Up: Map Next: 54878